1616
1717def get_module_path (modname ):
1818 """Return module *modname* base path"""
19- return osp .abspath (osp .dirname (sys .modules [modname ].__file__ ))
19+ return osp .abspath (
20+ osp .dirname (sys .modules [modname ].__file__ )
21+ )
2022
2123
22- def get_module_data_path (modname , relpath = None , attr_name = 'DATAPATH' ):
24+ def get_module_data_path (
25+ modname , relpath = None , attr_name = 'DATAPATH'
26+ ):
2327 """Return module *modname* data path
2428 Note: relpath is ignored if module has an attribute named *attr_name*
2529
@@ -33,12 +37,21 @@ def get_module_data_path(modname, relpath=None, attr_name='DATAPATH'):
3337 if osp .isfile (parentdir ):
3438 # Parent directory is not a directory but the 'library.zip' file:
3539 # this is either a py2exe or a cx_Freeze distribution
36- datapath = osp .abspath (osp .join (osp .join (parentdir , osp .pardir ),
37- modname ))
40+ datapath = osp .abspath (
41+ osp .join (
42+ osp .join (parentdir , osp .pardir ), modname
43+ )
44+ )
3845 if relpath is not None :
39- datapath = osp .abspath (osp .join (datapath , relpath ))
46+ datapath = osp .abspath (
47+ osp .join (datapath , relpath )
48+ )
4049 return datapath
4150
4251
43- DATA_PATH = get_module_data_path ('winpython' , relpath = 'data' )
44- IMAGE_PATH = get_module_data_path ('winpython' , relpath = 'images' )
52+ DATA_PATH = get_module_data_path (
53+ 'winpython' , relpath = 'data'
54+ )
55+ IMAGE_PATH = get_module_data_path (
56+ 'winpython' , relpath = 'images'
57+ )
0 commit comments