def main(): parser = create_parser(); (options, args) = parser.parse_args() record = RecordSpec(xml = sys.stdin.read()) if args: editDict(args, record.dict["record"], options) if options.DEBUG: print "New Record:\n%s" % record.dict record.pprint() record.parseDict(record.dict) s = record.toxml() sys.stdout.write(s)
def write(self): data = RecordSpec() data.parseDict(self) db_file = open(self.db_filename, 'w') db_file.write(data.toprettyxml()) db_file.close()