@@ -36,6 +36,7 @@ def __init__(
36
36
self .module = None
37
37
self .rel_import_path = rel_import_path
38
38
self .source = source
39
+ self .file_path = None
39
40
self .mtime = mtime
40
41
self .app_config = app_config
41
42
self .imports = set ()
@@ -97,6 +98,10 @@ def get_mtime(self):
97
98
"""Return the mtime."""
98
99
return self .mtime
99
100
101
+ def get_file_path (self ):
102
+ """Return the file path."""
103
+ return self .file_path
104
+
100
105
def get_imports (self ):
101
106
"""Return the imports."""
102
107
return self .imports
@@ -287,7 +292,7 @@ def new_name(cls, root):
287
292
return name
288
293
289
294
@classmethod
290
- async def load_file (cls , global_ctx , file_path , source = None , force = False ):
295
+ async def load_file (cls , global_ctx , file_path , source = None , reload = False ):
291
296
"""Load, parse and run the given script file; returns error ast_ctx on error, or None if ok."""
292
297
293
298
mtime = None
@@ -331,10 +336,11 @@ def read_file(path):
331
336
global_ctx .stop ()
332
337
return False , ast_ctx
333
338
global_ctx .source = source
339
+ global_ctx .file_path = file_path
334
340
if mtime is not None :
335
341
global_ctx .mtime = mtime
336
342
cls .set (global_ctx .get_name (), global_ctx )
337
343
338
- _LOGGER .info ("Loaded %s" , file_path )
344
+ _LOGGER .info ("%s %s" , "Reloaded" if reload else "Loaded " , file_path )
339
345
340
346
return True , None
0 commit comments