Example #1
0
 def load_flows_file(self, path):
     path = os.path.expanduser(path)
     try:
         if path == "-":
             # This is incompatible with Python 3 - maybe we can use click?
             freader = io.FlowReader(sys.stdin)
             return self.load_flows(freader)
         else:
             with open(path, "rb") as f:
                 freader = io.FlowReader(f)
                 return self.load_flows(freader)
     except IOError as v:
         raise exceptions.FlowReadException(v.strerror)
Example #2
0
 def r():
     r = io.FlowReader(open(p, "rb"))
     return list(r.stream())