3636import traceback
3737from ConfigParser import ConfigParser
3838# Local
39- import bass
40- import bolt
41- import env
42- import exception
43- import localize
39+ from . import bass
40+ from . import bolt
41+ from . import env
42+ from . import exception
43+ from . import localize
4444# NO OTHER LOCAL IMPORTS HERE (apart from the ones above) !
4545basher = balt = initialization = None
4646_wx = None
@@ -226,7 +226,7 @@ def _main(opts, wx_locale):
226226
227227 :param opts: command line arguments
228228 :param wx_locale: The wx.Locale object that we ended up using."""
229- import barg
229+ from . import barg
230230 bass .sys_argv = barg .convert_to_long_options (sys .argv )
231231
232232 if opts .debug :
@@ -237,7 +237,7 @@ def _main(opts, wx_locale):
237237 assure_single_instance (instance )
238238
239239 global initialization
240- import initialization
240+ from . import initialization
241241 #--Bash installation directories, set on boot, not likely to change
242242 initialization .init_dirs_mopy ()
243243
@@ -247,7 +247,7 @@ def _main(opts, wx_locale):
247247 msg2 = _ (u'done' )
248248 try : print msg1
249249 except UnicodeError : print msg1 .encode (bolt .Path .sys_fs_enc )
250- import belt # this imports bosh which imports wx (DUH)
250+ from . import belt # this imports bosh which imports wx (DUH)
251251 bolt .WryeText .genHtml (opts .genHtml )
252252 try : print msg2
253253 except UnicodeError : print msg2 .encode (bolt .Path .sys_fs_enc )
@@ -256,7 +256,7 @@ def _main(opts, wx_locale):
256256 # We need the Mopy dirs to initialize restore settings instance
257257 bash_ini_path , restore_ = u'bash.ini' , None
258258 # import barb that does not import from bosh/balt/bush
259- import barb
259+ from . import barb
260260 if opts .restore :
261261 try :
262262 restore_ = barb .RestoreSettings (opts .filename )
@@ -279,14 +279,14 @@ def _main(opts, wx_locale):
279279 bolt .deprint (u'Failed to restore backup' , traceback = True )
280280 restore_ .restore_ini ()
281281 # reset the game and ini
282- import bush
282+ from . import bush
283283 bush .reset_bush_globals ()
284284 bashIni , bush_game , game_ini_path = _detect_game (opts , u'bash.ini' )
285- import bosh # this imports balt (DUH) which imports wx
285+ from . import bosh # this imports balt (DUH) which imports wx
286286 bosh .initBosh (bashIni , game_ini_path )
287287 env .isUAC = env .testUAC (bush_game .gamePath .join (u'Data' ))
288288 global basher , balt
289- import basher , balt
289+ from . import basher , balt
290290 except (exception .BoltError , ImportError , OSError , IOError ) as e :
291291 msg = u'\n ' .join ([_ (u'Error! Unable to start Wrye Bash.' ), u'\n ' , _ (
292292 u'Please ensure Wrye Bash is correctly installed.' ), u'\n ' ,
@@ -393,7 +393,7 @@ def _detect_game(opts, backup_bash_ini):
393393 return bashIni , bush_game , game_ini_path
394394
395395def _import_bush_and_set_game (opts , bashIni ):
396- import bush
396+ from . import bush
397397 bolt .deprint (u'Searching for game to manage:' )
398398 ret , game_icons = bush .detect_and_set_game (opts .oblivionPath , bashIni )
399399 if ret is not None : # None == success
0 commit comments