LSF Debug
parent
b62666c9b5
commit
fd4ca459bc
|
@ -10,6 +10,8 @@ import os
|
|||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
import cakecms
|
||||
|
||||
DEBUG = False
|
||||
|
||||
"""
|
||||
|
||||
SAMPLE CONFIGURATION ('config.json'):
|
||||
|
@ -99,7 +101,17 @@ def import_to_cms(cms_config, matriculations):
|
|||
|
||||
if __name__ == '__main__':
|
||||
config = load_config()
|
||||
matriculations = extract_registrations(config)
|
||||
if DEBUG:
|
||||
if os.path.exists('matriculations.json'):
|
||||
print('Reading matriculations from file...')
|
||||
with open('matriculations.json', 'rb') as f:
|
||||
matriculations = json.loads(f.read())
|
||||
else:
|
||||
matriculations = extract_registrations(config)
|
||||
with open('matriculations.json', 'wb') as f:
|
||||
f.write(json.dumps(matriculations))
|
||||
else:
|
||||
matriculations = extract_registrations(config)
|
||||
for i, exam in enumerate(config['exams']):
|
||||
import_to_cms(exam['cms'], matriculations[i])
|
||||
print('Done')
|
||||
|
|
Loading…
Reference in New Issue