SyFi  0.3
print_references Namespace Reference

Functions

def read_data
def main

Function Documentation

def print_references.main (   argv)

Definition at line 21 of file print_references.py.

References read_data().

00021 
00022 def main(argv):
00023     folder, = argv
00024 
00025     # Data:
00026     files = sorted(glob.glob(os.path.join(folder, "*.ref")))
00027     datas = []
00028     print
00029     for fn in files:
00030         print "Reading ===", fn, "...",
00031         data = read_data(fn)
00032         datas.append((fn,data))
00033         print "Ok!"
00034     print
00035     for fn, data in datas:
00036         print "===", fn
00037         print data
00038     print
00039 
00040     # Timing:
00041     files = sorted(glob.glob(os.path.join(folder, "*.timing")))
00042     datas = []
00043     print
00044     for fn in files:
00045         print "Reading ===", fn, "...",
00046         data = read_data(fn)
00047         datas.append((fn,data))
00048         print "Ok!"
00049     print
00050     for fn, data in datas:
00051         print "===", fn
00052         print data
00053     print

Definition at line 9 of file print_references.py.

Referenced by main().

00009 
00010 def read_data(fn):
00011     try:
00012         f = open(fn)
00013         data = pickle.load(f)
00014         #data = f.read()
00015         f.close()
00016     except Exception, what:
00017         print "*** An error occured while trying to load reference file: %s" % fn
00018         print "*** Maybe you need to generate the reference? Returning None."
00019         data = None
00020     return data

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines