Changeset 1719 for pykota/trunk/bin
- Timestamp:
- 09/15/04 09:26:20 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/dumpykota
r1718 r1719 24 24 # 25 25 # $Log$ 26 # Revision 1.4 2004/09/15 07:26:19 jalet 27 # Data dumps are now ordered by entry creation date if applicable. 28 # Now dumpykota exits with a message when there's a broken pipe like 29 # in dumpykota --data history | head -3 30 # 26 31 # Revision 1.3 2004/09/15 06:58:25 jalet 27 32 # User groups membership and printer groups membership can now be dumped too … … 125 130 entries = getattr(self.storage, "extract%s" % datatype.title())() 126 131 if entries is not None : 127 getattr(self, "dump%s" % format.title())(entries)132 return getattr(self, "dump%s" % format.title())(entries) 128 133 return 0 129 134 … … 132 137 for entry in entries : 133 138 line = separator.join([ '"%s"' % field for field in entry ]) 134 print line 139 try : 140 print line 141 except IOError, msg : 142 sys.stderr.write("%s : %s\n" % (_("PyKota data dumper failed : I/O error"), msg)) 143 return -1 144 return 0 135 145 136 146 def dumpCsv(self, entries) : 137 147 """Dumps datas with a comma as the separator.""" 138 self.dumpWithSeparator(",", entries)148 return self.dumpWithSeparator(",", entries) 139 149 140 150 def dumpSsv(self, entries) : 141 151 """Dumps datas with a comma as the separator.""" 142 self.dumpWithSeparator(";", entries)152 return self.dumpWithSeparator(";", entries) 143 153 144 154 def dumpTsv(self, entries) : 145 155 """Dumps datas with a comma as the separator.""" 146 self.dumpWithSeparator("\t", entries)156 return self.dumpWithSeparator("\t", entries) 147 157 148 158 if __name__ == "__main__" :