1616# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818#
19- # $Id: admin.py,v 1.21 2002-08-01 01:07:37 richard Exp $
19+ # $Id: admin.py,v 1.22 2002-08-16 04:26:42 richard Exp $
2020
2121import sys , os , getpass , getopt , re , UserDict , shlex , shutil
2222try :
@@ -808,17 +808,23 @@ def do_retire(self, args):
808808 return 0
809809
810810 def do_export (self , args ):
811- '''Usage: export class[,class] destination_dir
811+ '''Usage: export [ class[,class] ] destination_dir
812812 Export the database to tab-separated-value files.
813813
814814 This action exports the current data from the database into
815815 tab-separated-value files that are placed in the nominated destination
816816 directory. The journals are not exported.
817817 '''
818- if len (args ) < 2 :
818+ # grab the directory to export to
819+ if len (args ) < 1 :
819820 raise UsageError , _ ('Not enough arguments supplied' )
820- classes = args [0 ].split (',' )
821- dir = args [1 ]
821+ dir = args [- 1 ]
822+
823+ # get the list of classes to export
824+ if len (args ) == 2 :
825+ classes = args [0 ].split (',' )
826+ else :
827+ classes = self .db .classes .keys ()
822828
823829 # use the csv parser if we can - it's faster
824830 if csv is not None :
@@ -831,7 +837,7 @@ def do_export(self, args):
831837 f .write (':' .join (cl .properties .keys ()) + '\n ' )
832838
833839 # all nodes for this class
834- properties = cl .properties . items ()
840+ properties = cl .getprops ()
835841 for nodeid in cl .list ():
836842 l = []
837843 for prop , proptype in properties :
@@ -1164,6 +1170,9 @@ def main(self):
11641170
11651171#
11661172# $Log: not supported by cvs2svn $
1173+ # Revision 1.21 2002/08/01 01:07:37 richard
1174+ # include info about new user roles
1175+ #
11671176# Revision 1.20 2002/08/01 00:56:22 richard
11681177# Added the web access and email access permissions, so people can restrict
11691178# access to users who register through the email interface (for example).
0 commit comments