1 | Batch processing via browser |
---|
2 | **************************** |
---|
3 | |
---|
4 | :test-layer: functional |
---|
5 | |
---|
6 | Preliminaries: |
---|
7 | |
---|
8 | We define a function that looks up a form with several submit buttons |
---|
9 | for the one with a given value (this functionality is missing in |
---|
10 | zope.testbrowser): |
---|
11 | |
---|
12 | >>> def lookup_submit_value(name, value, browser): |
---|
13 | ... """Find a button with a certain value.""" |
---|
14 | ... for num in range(0, 100): |
---|
15 | ... try: |
---|
16 | ... button = browser.getControl(name=name, index=num) |
---|
17 | ... if button.value.endswith(value): |
---|
18 | ... return button |
---|
19 | ... except IndexError: |
---|
20 | ... break |
---|
21 | ... return None |
---|
22 | |
---|
23 | Create a site: |
---|
24 | |
---|
25 | >>> from waeup.sirp.app import University |
---|
26 | >>> getRootFolder()['app'] = University() |
---|
27 | |
---|
28 | Create a datacenter storage path: |
---|
29 | |
---|
30 | >>> import os |
---|
31 | >>> import tempfile |
---|
32 | >>> dc_path = tempfile.mkdtemp() |
---|
33 | |
---|
34 | Log in: |
---|
35 | |
---|
36 | >>> from zope.testbrowser.testing import Browser |
---|
37 | >>> browser = Browser() |
---|
38 | >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw') |
---|
39 | >>> browser.handleErrors = False |
---|
40 | |
---|
41 | Set datacenter path and deselect moving old data: |
---|
42 | |
---|
43 | >>> browser.open('http://localhost/app') |
---|
44 | >>> browser.getLink('Data Center').click() |
---|
45 | >>> browser.getLink('Edit settings').click() |
---|
46 | >>> browser.getControl(name='newpath').value = dc_path |
---|
47 | >>> browser.getControl(name='move').value = False |
---|
48 | >>> browser.getControl(name='save').click() |
---|
49 | |
---|
50 | Batch processing faculties |
---|
51 | ========================== |
---|
52 | |
---|
53 | Go to datacenter page: |
---|
54 | |
---|
55 | >>> browser.open('http://localhost/app/datacenter') |
---|
56 | |
---|
57 | Prepare a CSV file for faculties: |
---|
58 | |
---|
59 | >>> open('faculties.csv', 'wb').write( |
---|
60 | ... """code,review_state,title,title_prefix |
---|
61 | ... FAC1,static,Faculty 1,faculty |
---|
62 | ... FAC2,static,Faculty 2,institute |
---|
63 | ... FAC3,static,Faculty 3,school_of |
---|
64 | ... """) |
---|
65 | |
---|
66 | Upload the file: |
---|
67 | |
---|
68 | >>> import cStringIO |
---|
69 | >>> browser.getLink('Upload CSV file').click() |
---|
70 | >>> filecontents = cStringIO.StringIO( |
---|
71 | ... open('faculties.csv', 'rb').read()) |
---|
72 | >>> filewidget = browser.getControl(name='uploadfile:file') |
---|
73 | >>> filewidget.add_file(filecontents, 'text/plain', 'faculties.csv') |
---|
74 | >>> browser.getControl(name='SUBMIT').click() |
---|
75 | |
---|
76 | Step 1: start batch processing: |
---|
77 | |
---|
78 | >>> browser.getLink('Batch processing').click() |
---|
79 | >>> button = lookup_submit_value( |
---|
80 | ... 'select', 'faculties_zope.mgr.csv', browser) |
---|
81 | >>> button.click() |
---|
82 | |
---|
83 | Step 2: select a processor and mode: |
---|
84 | |
---|
85 | >>> importerselect = browser.getControl(name='importer') |
---|
86 | >>> importerselect.displayOptions |
---|
87 | ['Applicants Container Importer', |
---|
88 | 'JAMB Data Importer', |
---|
89 | 'CertificateCourse importer', |
---|
90 | 'Certificate importer', |
---|
91 | 'Course importer', |
---|
92 | 'Department importer', |
---|
93 | 'Faculty importer'] |
---|
94 | |
---|
95 | >>> importerselect.getControl('Faculty importer').selected = True |
---|
96 | |
---|
97 | >>> modeselect = browser.getControl(name='mode') |
---|
98 | >>> modeselect.options |
---|
99 | ['create', 'update', 'remove'] |
---|
100 | |
---|
101 | >>> modeselect.getControl(value='create').selected = True |
---|
102 | >>> browser.getControl('Proceed to step 3...').click() |
---|
103 | |
---|
104 | Step 3: Fix headerlines |
---|
105 | |
---|
106 | We get informed that there are no problems with the current header: |
---|
107 | |
---|
108 | >>> print browser.contents |
---|
109 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
110 | ... |
---|
111 | Header fields OK |
---|
112 | ... |
---|
113 | |
---|
114 | The submit button is enabled: |
---|
115 | |
---|
116 | >>> browser.getControl('Perform import...').disabled |
---|
117 | False |
---|
118 | |
---|
119 | >>> browser.getControl('Perform import...').click() |
---|
120 | |
---|
121 | Step 4: See import results |
---|
122 | |
---|
123 | The import was successful: |
---|
124 | |
---|
125 | >>> print browser.contents |
---|
126 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
127 | ...Successfully processed 3 rows... |
---|
128 | ...Batch processing finished... |
---|
129 | ...File:...faculties_zope.mgr.csv... |
---|
130 | |
---|
131 | We can watch the entries generated in logfile: |
---|
132 | |
---|
133 | >>> browser.getControl('View processing log').click() |
---|
134 | >>> print browser.contents |
---|
135 | <!DOCTYPE ... |
---|
136 | <pre>... |
---|
137 | |
---|
138 | ... - INFO - -------------------- |
---|
139 | ... - INFO - zope.mgr: Batch processing finished: OK |
---|
140 | ... - INFO - zope.mgr: Source: /.../faculties_zope.mgr.csv |
---|
141 | ... - INFO - zope.mgr: Mode: create |
---|
142 | ... - INFO - zope.mgr: User: zope.mgr |
---|
143 | ... - INFO - zope.mgr: Processing time: ... s (... s/item) |
---|
144 | ... - INFO - zope.mgr: Processed: 3 lines (3 successful/ 0 failed) |
---|
145 | ... - INFO - -------------------- |
---|
146 | </pre> |
---|
147 | .... |
---|
148 | |
---|
149 | |
---|
150 | Batch processing departments |
---|
151 | ============================ |
---|
152 | |
---|
153 | >>> browser.open('http://localhost/app/datacenter') |
---|
154 | |
---|
155 | Prepare a CSV file for departments: |
---|
156 | |
---|
157 | >>> open('departments.csv', 'wb').write( |
---|
158 | ... """code,faculty_code,review_state,title,title_prefix |
---|
159 | ... DEP1,FAC1,static,Department 1,department |
---|
160 | ... DEP2,FAC2,static,Department 2,centre |
---|
161 | ... """) |
---|
162 | |
---|
163 | Upload the file: |
---|
164 | |
---|
165 | >>> import cStringIO |
---|
166 | >>> browser.getLink('Upload CSV file').click() |
---|
167 | >>> filecontents = cStringIO.StringIO( |
---|
168 | ... open('departments.csv', 'rb').read()) |
---|
169 | >>> filewidget = browser.getControl(name='uploadfile:file') |
---|
170 | >>> filewidget.add_file(filecontents, 'text/plain', 'departments.csv') |
---|
171 | >>> browser.getControl(name='SUBMIT').click() |
---|
172 | |
---|
173 | Step 1: start batch processing: |
---|
174 | |
---|
175 | >>> browser.getLink('Batch processing').click() |
---|
176 | >>> button = lookup_submit_value( |
---|
177 | ... 'select', 'departments_zope.mgr.csv', browser) |
---|
178 | >>> button.click() |
---|
179 | |
---|
180 | Step 2: select a processor and mode: |
---|
181 | |
---|
182 | >>> importerselect = browser.getControl(name='importer') |
---|
183 | >>> importerselect.getControl('Department importer').selected = True |
---|
184 | >>> modeselect = browser.getControl(name='mode') |
---|
185 | >>> modeselect.getControl(value='create').selected = True |
---|
186 | >>> browser.getControl('Proceed to step 3...').click() |
---|
187 | |
---|
188 | Step 3: Fix headerlines |
---|
189 | |
---|
190 | We get informed that there are no problems with the current header: |
---|
191 | |
---|
192 | >>> print browser.contents |
---|
193 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
194 | ... |
---|
195 | Header fields OK |
---|
196 | ... |
---|
197 | |
---|
198 | The submit button is enabled: |
---|
199 | |
---|
200 | >>> browser.getControl('Perform import...').disabled |
---|
201 | False |
---|
202 | |
---|
203 | >>> browser.getControl('Perform import...').click() |
---|
204 | |
---|
205 | Step 4: See import results |
---|
206 | |
---|
207 | The import was successful: |
---|
208 | |
---|
209 | >>> print browser.contents |
---|
210 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
211 | ...Successfully processed 2 rows... |
---|
212 | ...Batch processing finished... |
---|
213 | ...File:...departments_zope.mgr.csv... |
---|
214 | |
---|
215 | Batch processing courses |
---|
216 | ======================== |
---|
217 | |
---|
218 | >>> browser.open('http://localhost/app/datacenter') |
---|
219 | |
---|
220 | Prepare a CSV file for courses: |
---|
221 | |
---|
222 | >>> open('courses.csv', 'wb').write( |
---|
223 | ... """code,faculty_code,department_code,title,level,passmark,credits,semester |
---|
224 | ... CRS1,FAC1,DEP1,Course 1,100,40,2,1 |
---|
225 | ... CRS2,FAC1,DEP1,Course 2,100,40,2,2 |
---|
226 | ... """) |
---|
227 | |
---|
228 | Upload the file: |
---|
229 | |
---|
230 | >>> import cStringIO |
---|
231 | >>> browser.getLink('Upload CSV file').click() |
---|
232 | >>> filecontents = cStringIO.StringIO( |
---|
233 | ... open('courses.csv', 'rb').read()) |
---|
234 | >>> filewidget = browser.getControl(name='uploadfile:file') |
---|
235 | >>> filewidget.add_file(filecontents, 'text/plain', 'courses.csv') |
---|
236 | >>> browser.getControl(name='SUBMIT').click() |
---|
237 | |
---|
238 | Step 1: start batch processing: |
---|
239 | |
---|
240 | >>> browser.getLink('Batch processing').click() |
---|
241 | >>> button = lookup_submit_value( |
---|
242 | ... 'select', 'courses_zope.mgr.csv', browser) |
---|
243 | >>> button.click() |
---|
244 | |
---|
245 | Step 2: select a processor and mode: |
---|
246 | |
---|
247 | >>> importerselect = browser.getControl(name='importer') |
---|
248 | >>> importerselect.getControl('Course importer', index=1).selected = True |
---|
249 | >>> modeselect = browser.getControl(name='mode') |
---|
250 | >>> modeselect.getControl(value='create').selected = True |
---|
251 | >>> browser.getControl('Proceed to step 3...').click() |
---|
252 | |
---|
253 | Step 3: Fix headerlines |
---|
254 | |
---|
255 | We get informed that there are no problems with the current header: |
---|
256 | |
---|
257 | >>> print browser.contents |
---|
258 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
259 | ... |
---|
260 | Header fields OK |
---|
261 | ... |
---|
262 | |
---|
263 | The submit button is enabled: |
---|
264 | |
---|
265 | >>> browser.getControl('Perform import...').disabled |
---|
266 | False |
---|
267 | |
---|
268 | >>> browser.getControl('Perform import...').click() |
---|
269 | |
---|
270 | Step 4: See import results |
---|
271 | |
---|
272 | The import was successful: |
---|
273 | |
---|
274 | >>> print browser.contents |
---|
275 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
276 | ...Successfully processed 2 rows... |
---|
277 | ...Batch processing finished... |
---|
278 | ...File:...courses_zope.mgr.csv... |
---|
279 | |
---|
280 | Batch processing certificates |
---|
281 | ============================= |
---|
282 | |
---|
283 | >>> browser.open('http://localhost/app/datacenter') |
---|
284 | |
---|
285 | Prepare a CSV file for certificates: |
---|
286 | |
---|
287 | >>> open('certificates.csv', 'wb').write( |
---|
288 | ... """code,faculty_code,department_code,title,study_mode,start_level,end_level,application_category |
---|
289 | ... CERT1,FAC1,DEP1,Certificate 1,ug_ft,100,300,basic |
---|
290 | ... CERT2,FAC1,DEP1,Certificate 2,ug_ft,200,300,cest |
---|
291 | ... """) |
---|
292 | |
---|
293 | Upload the file: |
---|
294 | |
---|
295 | >>> import cStringIO |
---|
296 | >>> browser.getLink('Upload CSV file').click() |
---|
297 | >>> filecontents = cStringIO.StringIO( |
---|
298 | ... open('certificates.csv', 'rb').read()) |
---|
299 | >>> filewidget = browser.getControl(name='uploadfile:file') |
---|
300 | >>> filewidget.add_file(filecontents, 'text/plain', 'certificates.csv') |
---|
301 | >>> browser.getControl(name='SUBMIT').click() |
---|
302 | |
---|
303 | Step 1: start batch processing: |
---|
304 | |
---|
305 | >>> browser.getLink('Batch processing').click() |
---|
306 | >>> button = lookup_submit_value( |
---|
307 | ... 'select', 'certificates_zope.mgr.csv', browser) |
---|
308 | >>> button.click() |
---|
309 | |
---|
310 | |
---|
311 | Step 2: select a processor and mode: |
---|
312 | |
---|
313 | >>> importerselect = browser.getControl(name='importer') |
---|
314 | >>> importerselect.getControl('Certificate importer').selected = True |
---|
315 | >>> modeselect = browser.getControl(name='mode') |
---|
316 | >>> modeselect.getControl(value='create').selected = True |
---|
317 | >>> browser.getControl('Proceed to step 3...').click() |
---|
318 | |
---|
319 | Step 3: Fix headerlines |
---|
320 | |
---|
321 | We get informed that there are no problems with the current header: |
---|
322 | |
---|
323 | >>> print browser.contents |
---|
324 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
325 | ... |
---|
326 | Header fields OK |
---|
327 | ... |
---|
328 | |
---|
329 | The submit button is enabled: |
---|
330 | |
---|
331 | >>> browser.getControl('Perform import...').disabled |
---|
332 | False |
---|
333 | |
---|
334 | >>> browser.getControl('Perform import...').click() |
---|
335 | |
---|
336 | Step 4: See import results |
---|
337 | |
---|
338 | The import was successful: |
---|
339 | |
---|
340 | >>> print browser.contents |
---|
341 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
342 | ...Successfully processed 2 rows... |
---|
343 | ...Batch processing finished... |
---|
344 | ...File:...certificates_zope.mgr.csv... |
---|
345 | |
---|
346 | Batch processing certificate courses |
---|
347 | ==================================== |
---|
348 | |
---|
349 | >>> browser.open('http://localhost/app/datacenter') |
---|
350 | |
---|
351 | Prepare a CSV file for certificate courses: |
---|
352 | |
---|
353 | >>> open('mycertcourses.csv', 'wb').write( |
---|
354 | ... """course,faculty_code,department_code,certificate_code,level,core_or_elective |
---|
355 | ... CRS1,FAC1,DEP1,CERT1,100,True |
---|
356 | ... CRS2,FAC1,DEP1,CERT1,100,True |
---|
357 | ... """) |
---|
358 | |
---|
359 | Upload the file: |
---|
360 | |
---|
361 | >>> import cStringIO |
---|
362 | >>> browser.getLink('Upload CSV file').click() |
---|
363 | >>> filecontents = cStringIO.StringIO( |
---|
364 | ... open('mycertcourses.csv', 'rb').read()) |
---|
365 | >>> filewidget = browser.getControl(name='uploadfile:file') |
---|
366 | >>> filewidget.add_file(filecontents, 'text/plain', 'mycertcourses.csv') |
---|
367 | >>> browser.getControl(name='SUBMIT').click() |
---|
368 | |
---|
369 | Step 1: start batch processing: |
---|
370 | |
---|
371 | >>> browser.getLink('Batch processing').click() |
---|
372 | >>> button = lookup_submit_value( |
---|
373 | ... 'select', 'mycertcourses_zope.mgr.csv', browser) |
---|
374 | >>> button.click() |
---|
375 | |
---|
376 | Step 2: select a processor and mode: |
---|
377 | |
---|
378 | >>> importerselect = browser.getControl(name='importer') |
---|
379 | >>> importerselect.getControl('CertificateCourse importer').selected = True |
---|
380 | >>> modeselect = browser.getControl(name='mode') |
---|
381 | >>> modeselect.getControl(value='create').selected = True |
---|
382 | >>> browser.getControl('Proceed to step 3...').click() |
---|
383 | |
---|
384 | Step 3: Fix headerlines |
---|
385 | |
---|
386 | We get informed that there are no problems with the current header: |
---|
387 | |
---|
388 | >>> print browser.contents |
---|
389 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
390 | ... |
---|
391 | Header fields OK |
---|
392 | ... |
---|
393 | |
---|
394 | The submit button is enabled: |
---|
395 | |
---|
396 | >>> browser.getControl('Perform import...').disabled |
---|
397 | False |
---|
398 | |
---|
399 | >>> browser.getControl('Perform import...').click() |
---|
400 | |
---|
401 | Step 4: See import results |
---|
402 | |
---|
403 | The import was successful: |
---|
404 | |
---|
405 | >>> print browser.contents |
---|
406 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
407 | ...Successfully processed 2 rows... |
---|
408 | ...Batch processing finished... |
---|
409 | ...File:...mycertcourses_zope.mgr.csv... |
---|
410 | |
---|
411 | |
---|
412 | Pending files |
---|
413 | ============= |
---|
414 | |
---|
415 | When an error occurs during an import, two files are generated: a CSV |
---|
416 | file with finished files and a CSV file with pending data. Both are |
---|
417 | stored in the appropriate subdirectories in datacenter. We try to |
---|
418 | create faculties, from which one already exists. |
---|
419 | |
---|
420 | Go to datacenter page: |
---|
421 | |
---|
422 | >>> browser.open('http://localhost/app/datacenter') |
---|
423 | |
---|
424 | Prepare a CSV file for faculties: |
---|
425 | |
---|
426 | >>> open('newfaculties.csv', 'wb').write( |
---|
427 | ... """code,review_state,title,title_prefix |
---|
428 | ... FAC1,static,Faculty 1,faculty |
---|
429 | ... FAC4,static,Faculty 4,school_of |
---|
430 | ... """) |
---|
431 | |
---|
432 | Upload the file: |
---|
433 | |
---|
434 | >>> import cStringIO |
---|
435 | >>> browser.getLink('Upload CSV file').click() |
---|
436 | >>> filecontents = cStringIO.StringIO( |
---|
437 | ... open('newfaculties.csv', 'rb').read()) |
---|
438 | >>> filewidget = browser.getControl(name='uploadfile:file') |
---|
439 | >>> filewidget.add_file(filecontents, 'text/plain', 'newfaculties.csv') |
---|
440 | >>> browser.getControl(name='SUBMIT').click() |
---|
441 | |
---|
442 | Step 1: start batch processing: |
---|
443 | |
---|
444 | >>> browser.getLink('Batch processing').click() |
---|
445 | >>> button = lookup_submit_value( |
---|
446 | ... 'select', 'newfaculties_zope.mgr.csv', browser) |
---|
447 | >>> button.click() |
---|
448 | |
---|
449 | Step 2: select a processor and mode: |
---|
450 | |
---|
451 | >>> importerselect = browser.getControl(name='importer') |
---|
452 | >>> importerselect.getControl('Faculty importer').selected = True |
---|
453 | >>> modeselect = browser.getControl(name='mode') |
---|
454 | >>> modeselect.getControl(value='create').selected = True |
---|
455 | >>> browser.getControl('Proceed to step 3...').click() |
---|
456 | |
---|
457 | Step 3: Fix headerlines |
---|
458 | |
---|
459 | As there should be no problem with the headers, we can immediately |
---|
460 | perfom the import: |
---|
461 | |
---|
462 | >>> browser.getControl('Perform import...').click() |
---|
463 | |
---|
464 | One line could not be imported: |
---|
465 | |
---|
466 | >>> print browser.contents |
---|
467 | <!DOCTYPE html PUBLIC... |
---|
468 | ... |
---|
469 | ...Processing of 1 rows failed... |
---|
470 | ...Successfully processed 1 rows... |
---|
471 | ... |
---|
472 | |
---|
473 | Now there are two files as a result in datacenter storage's root and |
---|
474 | ``finished`` dirs: |
---|
475 | |
---|
476 | >>> pending_file = dc_path + '/newfaculties_zope.mgr.create.pending.csv' |
---|
477 | >>> print open(pending_file).read() |
---|
478 | title_prefix,--IGNORE--,code,title,--ERRORS-- |
---|
479 | faculty,static,FAC1,Faculty 1,This object already exists in the same container. Skipping. |
---|
480 | |
---|
481 | >>> finished_file = dc_path + '/finished/newfaculties_zope.mgr.create.finished.csv' |
---|
482 | >>> print open(finished_file).read() |
---|
483 | title_prefix,--IGNORE--,code,title |
---|
484 | school_of,static,FAC4,Faculty 4 |
---|
485 | |
---|
486 | The finished-file contains the dataset we could import, while the |
---|
487 | pending file contains the dataset that failed, appended by an error |
---|
488 | message. |
---|
489 | |
---|
490 | |
---|
491 | Fixing the pending file |
---|
492 | ----------------------- |
---|
493 | |
---|
494 | We 'edit' the pending file (setting code to ``FAC5`` and title |
---|
495 | appropriately, and removing the --ERROR-- column) and finish the |
---|
496 | import this way: |
---|
497 | |
---|
498 | >>> open(dc_path + '/newfaculties_zope.mgr.create.pending.csv', 'wb').write( |
---|
499 | ... """title_prefix,--IGNORE--,code,title |
---|
500 | ... faculty,static,FAC5,Faculty 5 |
---|
501 | ... """) |
---|
502 | |
---|
503 | Step 1: start batch processing: |
---|
504 | |
---|
505 | >>> browser.open('http://localhost/app/datacenter') |
---|
506 | >>> browser.getLink('Batch processing').click() |
---|
507 | >>> button = lookup_submit_value( |
---|
508 | ... 'select', 'newfaculties_zope.mgr.create.pending.csv', browser) |
---|
509 | >>> button.click() |
---|
510 | |
---|
511 | Step 2: select a processor and mode: |
---|
512 | |
---|
513 | >>> importerselect = browser.getControl(name='importer') |
---|
514 | >>> importerselect.getControl('Faculty importer').selected = True |
---|
515 | >>> modeselect = browser.getControl(name='mode') |
---|
516 | >>> modeselect.getControl(value='create').selected = True |
---|
517 | >>> browser.getControl('Proceed to step 3...').click() |
---|
518 | |
---|
519 | Step 3/4: Fix headerlines and import: |
---|
520 | |
---|
521 | As there should be no problem with the headers, we can immediately |
---|
522 | perfom the import: |
---|
523 | |
---|
524 | >>> browser.getControl('Perform import...').click() |
---|
525 | |
---|
526 | This time everything should work: |
---|
527 | |
---|
528 | >>> print browser.contents |
---|
529 | <!DOCTYPE html PUBLIC... |
---|
530 | ... |
---|
531 | ...Successfully processed 1 rows... |
---|
532 | ... |
---|
533 | |
---|
534 | >>> sorted(os.listdir(dc_path)) |
---|
535 | ['finished', 'logs', 'unfinished'] |
---|
536 | |
---|
537 | >>> os.listdir(dc_path + '/unfinished') |
---|
538 | [] |
---|
539 | |
---|
540 | >>> sorted(os.listdir(dc_path + '/finished')) |
---|
541 | ['certificates_zope.mgr.create.finished.csv', ..., |
---|
542 | 'newfaculties_zope.mgr.create.finished.csv', |
---|
543 | 'newfaculties_zope.mgr.csv'] |
---|
544 | |
---|
545 | |
---|
546 | Clean up: |
---|
547 | |
---|
548 | >>> import shutil |
---|
549 | >>> shutil.rmtree(dc_path) |
---|