@@ -53,18 +53,22 @@ def get_project_subroot(view):
53
53
sub_root_setting = project_data .get ('root' , "" )
54
54
return sub_root_setting
55
55
56
- def get_project_app_path (view ):
57
- """ Returns a path to a certain Archicad version, if set in the project file .
58
- (Useful if one is developing for different Archicad versions and
56
+ def get_ac_path (view , pckgset ):
57
+ """ Returns a path to a certain Archicad version, either from project file or the global settings .
58
+ (Former is useful if one is developing for different Archicad versions and
59
59
they want to use the appropiate LP Converter version.)
60
60
"""
61
61
project_data = view .window ().project_data ()
62
- app_path = project_data .get ('AC_path' , "" )
63
- return app_path
62
+ proj_ac_path = project_data .get ('AC_path' , "" )
63
+ if not proj_ac_path :
64
+ ac_path = str (pckgset .get ("AC_path" , DEFAULT_AC_PATH ))
65
+ else :
66
+ ac_path = proj_ac_path
67
+ return ac_path
64
68
65
69
def err (text ):
66
70
""" Gives us a ST error message. """
67
- if text == None :
71
+ if not text : # None or empty
68
72
text = "Sorry. Something went wrong."
69
73
sublime .error_message (text )
70
74
@@ -120,11 +124,7 @@ def run(self, *args, **kwargs):
120
124
self .pckg_settings = sublime .load_settings (PACKAGE_SETTINGS )
121
125
122
126
# get the path to the LP_XML_Converter right
123
- project_app_path = get_project_app_path (self .view )
124
- if project_app_path == None :
125
- self .AC_path = str (self .pckg_settings .get ("AC_path" , DEFAULT_AC_PATH ))
126
- else :
127
- self .AC_path = project_app_path
127
+ self .AC_path = get_ac_path (self .view , self .pckg_settings )
128
128
129
129
self .lp_conv_path = self .check_system ()
130
130
self .converter = os .path .join (self .AC_path , self .lp_conv_path )
0 commit comments