MCPcopy Index your code
hub / github.com/webpy/webpy / modname

Method modname

web/application.py:67–77  ·  view source on GitHub ↗

find name of the module name from fvars.

(fvars)

Source from the content-addressed store, hash-verified

65 return file and os.path.splitext(os.path.basename(file))[0]
66
67 def modname(fvars):
68 """find name of the module name from fvars."""
69 file, name = fvars.get("__file__"), fvars.get("__name__")
70 if file is None or name is None:
71 return None
72
73 if name == "__main__":
74 # Since the __main__ module can't be reloaded, the module has
75 # to be imported using its file name.
76 name = main_module_name()
77 return name
78
79 mapping_name = utils.dictfind(fvars, mapping)
80 module_name = modname(fvars)

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected