示例#1
0
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)
示例#2
0
文件: storage.py 项目: planetlab/sfa
 def write(self):
     data = RecordSpec()
     data.parseDict(self)
     db_file = open(self.db_filename, 'w')
     db_file.write(data.toprettyxml())
     db_file.close()