Mercurial > p > roundup > code
comparison roundup-admin @ 280:80ad2bf9cf7b
The setup.cfg file is just causing pain. Away it goes.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 10 Oct 2001 04:12:32 +0000 |
| parents | a5dabf2430c5 |
| children | a6e3a9164814 |
comparison
equal
deleted
inserted
replaced
| 279:231a031e4765 | 280:80ad2bf9cf7b |
|---|---|
| 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.24 2001-10-10 03:54:57 richard Exp $ | 19 # $Id: roundup-admin,v 1.25 2001-10-10 04:12:32 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) |
| 382 def do_import(db, args): | 382 def do_import(db, args): |
| 383 '''Usage: import class file | 383 '''Usage: import class file |
| 384 Import the contents of the CSV file as new nodes for the given class. | 384 Import the contents of the CSV file as new nodes for the given class. |
| 385 | 385 |
| 386 The file must define the same properties as the class (including having | 386 The file must define the same properties as the class (including having |
| 387 a "header" line with those property names.) | 387 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 | |
| 389 imported data, then create a new database (or, tediously, retire all | |
| 390 the old data.) | |
| 388 ''' | 391 ''' |
| 389 if len(args) < 2: | 392 if len(args) < 2: |
| 390 print do_export.__doc__ | 393 print do_export.__doc__ |
| 391 return 1 | 394 return 1 |
| 392 if csv is None: | 395 if csv is None: |
| 560 if __name__ == '__main__': | 563 if __name__ == '__main__': |
| 561 sys.exit(main()) | 564 sys.exit(main()) |
| 562 | 565 |
| 563 # | 566 # |
| 564 # $Log: not supported by cvs2svn $ | 567 # $Log: not supported by cvs2svn $ |
| 568 # Revision 1.24 2001/10/10 03:54:57 richard | |
| 569 # Added database importing and exporting through CSV files. | |
| 570 # Uses the csv module from object-craft for exporting if it's available. | |
| 571 # Requires the csv module for importing. | |
| 572 # | |
| 565 # Revision 1.23 2001/10/09 23:36:25 richard | 573 # Revision 1.23 2001/10/09 23:36:25 richard |
| 566 # Spit out command help if roundup-admin command doesn't get an argument. | 574 # Spit out command help if roundup-admin command doesn't get an argument. |
| 567 # | 575 # |
| 568 # Revision 1.22 2001/10/09 07:25:59 richard | 576 # Revision 1.22 2001/10/09 07:25:59 richard |
| 569 # Added the Password property type. See "pydoc roundup.password" for | 577 # Added the Password property type. See "pydoc roundup.password" for |
