MCPcopy Create free account
hub / github.com/dobin/SuperMega / start

Function start

supermega.py:105–141  ·  view source on GitHub ↗

Main entry point for the application. Will handle log files and cleanup

(settings: Settings)

Source from the content-addressed store, hash-verified

103
104
105def start(settings: Settings) -> int:
106 """Main entry point for the application. Will handle log files and cleanup"""
107
108 # Delete: all old files
109 clean_tmp_files()
110 if settings.cleanup_files_on_start:
111 clean_files(settings)
112
113 # And logs
114 observer.reset()
115
116 # Set new keys
117 config.make_encryption_keys()
118
119 # Prepare the project: copy all files to projects/<project_name>/
120 prepare_project(settings.project_name)
121
122 # Do the thing and catch the errors
123 ret = False
124 if config.catch_exception:
125 ret = start_real(settings)
126 else:
127 try:
128 ret = start_real(settings)
129 except Exception as e:
130 logger.error(f'Error compiling: {e}')
131 observer.write_logs(settings.project_path)
132 return 1
133
134 # Cleanup files
135 clean_tmp_files()
136 if settings.cleanup_files_on_exit:
137 clean_files(settings)
138
139 # Write logs (on success)
140 observer.write_logs(settings.project_path)
141 return ret
142
143
144def sanity_checks(settings):

Callers 8

test_commonFunction · 0.90
test_exe_dataFunction · 0.90
test_exe_codeFunction · 0.90
test_dll_codeFunction · 0.90
test_dll_dataFunction · 0.90
test_dll_loaderFunction · 0.90
supermega_threadFunction · 0.90
mainFunction · 0.85

Calls 7

prepare_projectFunction · 0.90
clean_tmp_filesFunction · 0.85
clean_filesFunction · 0.85
start_realFunction · 0.85
make_encryption_keysMethod · 0.80
write_logsMethod · 0.80
resetMethod · 0.45

Tested by 6

test_commonFunction · 0.72
test_exe_dataFunction · 0.72
test_exe_codeFunction · 0.72
test_dll_codeFunction · 0.72
test_dll_dataFunction · 0.72
test_dll_loaderFunction · 0.72