Skip to content

Commit e0efd16

Browse files
committed
qtvcp -pstat: add convenience function to convert file name to module pathname
used for subclassing handler files
1 parent fc3029d commit e0efd16

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/python/qtvcp/qt_pstat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,12 @@ def find_vismach_files(self):
420420

421421
return tmp
422422

423+
def modnamefromFilename(self, fname):
424+
panel = os.path.splitext(os.path.basename(os.path.basename(fname)))[0]
425+
base = panel.replace('_handler','')
426+
module = "{}.{}".format(base,panel)
427+
return module
428+
423429
# tempararily adds the screen directory to path
424430
# so the handler can be imported to be used for subclassing
425431
def importDefaultHandler(self, module=None):

0 commit comments

Comments
 (0)