MCPcopy
hub / github.com/deadc0de6/dotdrop / main

Function main

dotdrop/dotdrop.py:926–972  ·  view source on GitHub ↗

entry point

()

Source from the content-addressed store, hash-verified

924
925
926def main():
927 """entry point"""
928 # check dependencies are met
929 try:
930 dependencies_met()
931 except UnmetDependency as exc:
932 LOG.err(exc)
933 return False
934
935 time0 = time.time()
936 try:
937 opts = Options()
938 except YamlException as exc:
939 LOG.err(f'yaml error: {exc}')
940 return False
941 except ConfigException as exc:
942 LOG.err(f'config error: {exc}')
943 return False
944 except UndefinedException as exc:
945 LOG.err(f'dependencies error: {exc}')
946 return False
947 except OptionsException as exc:
948 LOG.err(f'options error: {exc}')
949 return False
950
951 if opts.debug:
952 LOG.debug = opts.debug
953 LOG.dbg('\n\n')
954 options_time = time.time() - time0
955
956 if opts.check_version:
957 check_version()
958
959 time0 = time.time()
960 ret, command = _exec_command(opts)
961 cmd_time = time.time() - time0
962
963 opts.debug_command()
964 LOG.dbg(f'done executing command \"{command}\"')
965 LOG.dbg(f'options loaded in {options_time}')
966 LOG.dbg(f'command executed in {cmd_time}')
967
968 if ret and opts.conf.save():
969 LOG.log('config file updated')
970
971 LOG.dbg(f'return {ret}')
972 return ret
973
974
975if __name__ == '__main__':

Callers 1

dotdrop.pyFile · 0.70

Calls 9

debug_commandMethod · 0.95
dependencies_metFunction · 0.90
OptionsClass · 0.90
check_versionFunction · 0.90
_exec_commandFunction · 0.85
errMethod · 0.80
dbgMethod · 0.80
logMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected