Skip to content
Snippets Groups Projects
Commit ee1b3c4d authored by baigner's avatar baigner
Browse files

1.) Added write_log as argument to vistoms.py (user can decide whether he wants logging or not)

2.) Style changes


Former-commit-id: 6e3d930dbeff2e5e048a754fe5ec1b32bd849ccf
parent dbedd7a8
No related branches found
No related tags found
No related merge requests found
Pipeline #192827 canceled
......@@ -19528,9 +19528,10 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
$('.myPanel').lobiPanel('height','5000');
}
}
}
......@@ -20896,7 +20897,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -21290,7 +21291,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -21859,7 +21860,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -23017,7 +23018,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -23169,7 +23170,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -23931,7 +23932,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -25609,7 +25610,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -25829,7 +25830,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -26389,7 +26390,7 @@
minWidth: 200,
minHeight: 200,
maxWidth: 1100,
maxHeight: 1100,
maxHeight: 1200,
});
$('.myPanel').lobiPanel('unpin');
}
......@@ -17,9 +17,6 @@ from kadmos.graph import load, FundamentalProblemGraph
app = Flask(__name__)
# Settings for logging
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
# Folder and file settings
UPLOAD_FOLDER = ''
TEMP_FILE = 'tmp'
......@@ -1535,10 +1532,15 @@ def kadmosImposeMDAOArchitecture():
# Then in the run_vistoms handle the folder and open_vistoms
# arguments as follows:
def run_vistoms(folder=None):
def run_vistoms(folder=None, write_log=True, open_vistoms=True):
global UPLOAD_FOLDER
# Open VISTOMS when running the app.py in the beginning
webbrowser.open_new('http://127.0.0.1:5000/VISTOMS')
if open_vistoms:
# Open VISTOMS when running the app.py in the beginning
webbrowser.open_new('http://127.0.0.1:5000/VISTOMS')
if write_log:
# Settings for logging
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
if folder is None:
# Create temporary directory
......@@ -1562,6 +1564,7 @@ def run_vistoms(folder=None):
# python vistoms.py
# python vistoms.py -folder C:/Users/aigner/Desktop/vistoms_tmp
# python vistoms.py -open y -folder C:/Users/aigner/Desktop/vistoms_tmp
# python vistoms.py -open y -folder C:/Users/aigner/Desktop/vistoms_tmp -write_log y
if __name__ == '__main__':
# Get system arguments
args = sys.argv
......@@ -1583,5 +1586,17 @@ if __name__ == '__main__':
raise IOError('Please provide valid argument for -open, either y or n.')
else:
open_vistoms = True # default is to open
# Check if write_log is given in args
if '-write_log' in args:
write_log = args[args.index('-write_log') + 1]
assert write_log.lower() in ['y', 'yes', 'n', 'no']
if write_log.lower() in ['y', 'yes']:
write_log = True
elif write_log.lower() in ['n', 'no']:
write_log = False
else:
raise IOError('Please provide valid argument for -open, either y or n.')
else:
write_log = True
# Now run the Python VISTOMS method that you have in app.py
run_vistoms(folder=folder)
\ No newline at end of file
run_vistoms(folder=folder, write_log=write_log, open_vistoms=open_vistoms)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment