Mercurial > p > roundup > code
comparison roundup-admin @ 285:a6e3a9164814 0.3.0-pre2
Marked the roundup-admin import/export as experimental...
...since they're not fully operational.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 11 Oct 2001 05:03:51 +0000 |
| parents | 80ad2bf9cf7b |
| children | ee2f4cb160bd |
comparison
equal
deleted
inserted
replaced
| 284:ab74a46c3a9d | 285:a6e3a9164814 |
|---|---|
| 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 18 # | 18 # |
| 19 # $Id: roundup-admin,v 1.25 2001-10-10 04:12:32 richard Exp $ | 19 # $Id: roundup-admin,v 1.26 2001-10-11 05:03:51 richard Exp $ |
| 20 | 20 |
| 21 import sys | 21 import sys |
| 22 if int(sys.version[0]) < 2: | 22 if int(sys.version[0]) < 2: |
| 23 print 'Roundup requires python 2.0 or later.' | 23 print 'Roundup requires python 2.0 or later.' |
| 24 sys.exit(1) | 24 sys.exit(1) |
| 338 db.getclass(classname).retire(nodeid) | 338 db.getclass(classname).retire(nodeid) |
| 339 return 0 | 339 return 0 |
| 340 | 340 |
| 341 def do_export(db, args): | 341 def do_export(db, args): |
| 342 '''Usage: export class[,class] destination_dir | 342 '''Usage: export class[,class] destination_dir |
| 343 ** EXPERIMENTAL ** | |
| 343 Export the database to CSV files by class in the given directory. | 344 Export the database to CSV files by class in the given directory. |
| 344 | 345 |
| 345 This action exports the current data from the database into | 346 This action exports the current data from the database into |
| 346 comma-separated files that are placed in the nominated destination | 347 comma-separated files that are placed in the nominated destination |
| 347 directory. The journals are not exported. | 348 directory. The journals are not exported. |
| 379 f.write(','.join(l) + '\n') | 380 f.write(','.join(l) + '\n') |
| 380 return 0 | 381 return 0 |
| 381 | 382 |
| 382 def do_import(db, args): | 383 def do_import(db, args): |
| 383 '''Usage: import class file | 384 '''Usage: import class file |
| 385 ** EXPERIMENTAL ** | |
| 384 Import the contents of the CSV file as new nodes for the given class. | 386 Import the contents of the CSV file as new nodes for the given class. |
| 385 | 387 |
| 386 The file must define the same properties as the class (including having | 388 The file must define the same properties as the class (including having |
| 387 a "header" line with those property names.) The new nodes are added to | 389 a "header" line with those property names.) The new nodes are added to |
| 388 the existing database - if you want to create a new database using the | 390 the existing database - if you want to create a new database using the |
| 563 if __name__ == '__main__': | 565 if __name__ == '__main__': |
| 564 sys.exit(main()) | 566 sys.exit(main()) |
| 565 | 567 |
| 566 # | 568 # |
| 567 # $Log: not supported by cvs2svn $ | 569 # $Log: not supported by cvs2svn $ |
| 570 # Revision 1.25 2001/10/10 04:12:32 richard | |
| 571 # The setup.cfg file is just causing pain. Away it goes. | |
| 572 # | |
| 568 # Revision 1.24 2001/10/10 03:54:57 richard | 573 # Revision 1.24 2001/10/10 03:54:57 richard |
| 569 # Added database importing and exporting through CSV files. | 574 # Added database importing and exporting through CSV files. |
| 570 # Uses the csv module from object-craft for exporting if it's available. | 575 # Uses the csv module from object-craft for exporting if it's available. |
| 571 # Requires the csv module for importing. | 576 # Requires the csv module for importing. |
| 572 # | 577 # |
