src/eric7/Documentation/Source/eric7.MicroPython.Devices.CircuitPythonUpdater.CircupFunctions.html

branch
eric7
changeset 9756
9854647c8c5c
child 10479
856476537696
equal deleted inserted replaced
9755:1a09700229e7 9756:9854647c8c5c
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.MicroPython.Devices.CircuitPythonUpdater.CircupFunctions</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.MicroPython.Devices.CircuitPythonUpdater.CircupFunctions</h1>
10
11 <p>
12 Module implementing variants of some 'circup' functions suitable for 'eric-ide'
13 integration.
14 </p>
15 <h3>Global Attributes</h3>
16
17 <table>
18 <tr><td>None</td></tr>
19 </table>
20 <h3>Classes</h3>
21
22 <table>
23 <tr><td>None</td></tr>
24 </table>
25 <h3>Functions</h3>
26
27 <table>
28
29 <tr>
30 <td><a href="#ensure_latest_bundle">ensure_latest_bundle</a></td>
31 <td>Function to ensure that there's a copy of the latest library bundle available so circup can check the metadata contained therein.</td>
32 </tr>
33 <tr>
34 <td><a href="#find_modules">find_modules</a></td>
35 <td>Function to extract metadata from the connected device and available bundles and returns this as a list of Module instances representing the modules on the device.</td>
36 </tr>
37 <tr>
38 <td><a href="#get_circuitpython_version">get_circuitpython_version</a></td>
39 <td>Function to return the version number of CircuitPython running on the board connected via ``device_path``, along with the board ID.</td>
40 </tr>
41 <tr>
42 <td><a href="#install_module">install_module</a></td>
43 <td>Function to find a connected device and install a given module name.</td>
44 </tr>
45 <tr>
46 <td><a href="#patch_circup">patch_circup</a></td>
47 <td>Function to patch 'circup' to use our functions adapted to the use within the eric-ide.</td>
48 </tr>
49 </table>
50 <hr />
51 <hr />
52 <a NAME="ensure_latest_bundle" ID="ensure_latest_bundle"></a>
53 <h2>ensure_latest_bundle</h2>
54 <b>ensure_latest_bundle</b>(<i>bundle</i>)
55
56 <p>
57 Function to ensure that there's a copy of the latest library bundle available so
58 circup can check the metadata contained therein.
59 </p>
60 <dl>
61
62 <dt><i>bundle</i> (circup.Bundle)</dt>
63 <dd>
64 reference to the target Bundle object.
65 </dd>
66 </dl>
67 <div align="right"><a href="#top">Up</a></div>
68 <hr />
69 <hr />
70 <a NAME="find_modules" ID="find_modules"></a>
71 <h2>find_modules</h2>
72 <b>find_modules</b>(<i>device_path, bundles_list</i>)
73
74 <p>
75 Function to extract metadata from the connected device and available bundles and
76 returns this as a list of Module instances representing the modules on the device.
77 </p>
78 <dl>
79
80 <dt><i>device_path</i> (str)</dt>
81 <dd>
82 path to the connected board
83 </dd>
84 <dt><i>bundles_list</i> (list of circup.Bundle)</dt>
85 <dd>
86 list of supported bundles
87 </dd>
88 </dl>
89 <dl>
90 <dt>Return:</dt>
91 <dd>
92 list of Module instances describing the current state of the
93 modules on the connected device
94 </dd>
95 </dl>
96 <dl>
97 <dt>Return Type:</dt>
98 <dd>
99 list of circup.Module
100 </dd>
101 </dl>
102 <div align="right"><a href="#top">Up</a></div>
103 <hr />
104 <hr />
105 <a NAME="get_circuitpython_version" ID="get_circuitpython_version"></a>
106 <h2>get_circuitpython_version</h2>
107 <b>get_circuitpython_version</b>(<i>device_path</i>)
108
109 <p>
110 Function to return the version number of CircuitPython running on the board
111 connected via ``device_path``, along with the board ID.
112 </p>
113 <p>
114 This is obtained from the 'boot_out.txt' file on the device, whose first line
115 will start with something like this:
116 </p>
117 <p>
118 Adafruit CircuitPython 4.1.0 on 2019-08-02;
119 </p>
120 <p>
121 While the second line is:
122 </p>
123 <p>
124 Board ID:raspberry_pi_pico
125 </p>
126 <dl>
127
128 <dt><i>device_path</i> (str)</dt>
129 <dd>
130 path to the connected board.
131 </dd>
132 </dl>
133 <dl>
134 <dt>Return:</dt>
135 <dd>
136 tuple with the version string for CircuitPython and the board ID string
137 </dd>
138 </dl>
139 <dl>
140 <dt>Return Type:</dt>
141 <dd>
142 tuple of (str, str)
143 </dd>
144 </dl>
145 <div align="right"><a href="#top">Up</a></div>
146 <hr />
147 <hr />
148 <a NAME="install_module" ID="install_module"></a>
149 <h2>install_module</h2>
150 <b>install_module</b>(<i>device_path, device_modules, name, py, mod_names</i>)
151
152 <p>
153 Function to find a connected device and install a given module name.
154 </p>
155 <p>
156 Installation is done if it is available in the current module bundle and is not
157 already installed on the device.
158 </p>
159 <dl>
160
161 <dt><i>device_path</i> (str)</dt>
162 <dd>
163 path to the connected board
164 </dd>
165 <dt><i>device_modules</i> (list of dict)</dt>
166 <dd>
167 list of module metadata from the device
168 </dd>
169 <dt><i>name</i> (str)</dt>
170 <dd>
171 name of the module to be installed
172 </dd>
173 <dt><i>py</i> (bool)</dt>
174 <dd>
175 flag indicating if the module should be installed from source or
176 from a pre-compiled module
177 </dd>
178 <dt><i>mod_names</i> (dict)</dt>
179 <dd>
180 dictionary containing metadata from modules that can be generated
181 with circup.get_bundle_versions()
182 </dd>
183 </dl>
184 <dl>
185 <dt>Return:</dt>
186 <dd>
187 flag indicating success
188 </dd>
189 </dl>
190 <dl>
191 <dt>Return Type:</dt>
192 <dd>
193 bool
194 </dd>
195 </dl>
196 <div align="right"><a href="#top">Up</a></div>
197 <hr />
198 <hr />
199 <a NAME="patch_circup" ID="patch_circup"></a>
200 <h2>patch_circup</h2>
201 <b>patch_circup</b>(<i></i>)
202
203 <p>
204 Function to patch 'circup' to use our functions adapted to the use within the
205 eric-ide.
206 </p>
207 <div align="right"><a href="#top">Up</a></div>
208 <hr />
209 </body></html>

eric ide

mercurial