Commit 08835262 authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team

fuse.py, ListWindows.load(): optional verbose argument

parent 0764e954
...@@ -331,14 +331,15 @@ class ListWindows: ...@@ -331,14 +331,15 @@ class ListWindows:
with open(output, "w") as file: with open(output, "w") as file:
json.dump(self, file, indent=2, default=self.toJson) json.dump(self, file, indent=2, default=self.toJson)
def load(self, file_path, pipeline): def load(self, file_path, pipeline, verbose=True):
'''init listWindows with data file '''init listWindows with data file
Detects and selects the parser according to the file extension.''' Detects and selects the parser according to the file extension.'''
# name = file_path.split("/")[-1] # name = file_path.split("/")[-1]
extension = file_path.split('.')[-1] extension = file_path.split('.')[-1]
print "<==", file_path, "\t", if verbose:
print "<==", file_path, "\t",
try: try:
...@@ -354,11 +355,13 @@ class ListWindows: ...@@ -354,11 +355,13 @@ class ListWindows:
if pipeline: if pipeline:
# renaming, private pipeline # renaming, private pipeline
f = '/'.join(file_path.split('/')[2:-1]) f = '/'.join(file_path.split('/')[2:-1])
print "[%s]" % f if verbose:
print "[%s]" % f
else: else:
f = file_path f = file_path
print if verbose:
print
time = os.path.getmtime(file_path) time = os.path.getmtime(file_path)
self.d["timestamp"] = [datetime.datetime.fromtimestamp(time).strftime("%Y-%m-%d %H:%M:%S")] self.d["timestamp"] = [datetime.datetime.fromtimestamp(time).strftime("%Y-%m-%d %H:%M:%S")]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment