Remove pointless calls to GetOS() everywhere
This commit is contained in:
parent
d3fd0a38f0
commit
6b89df173f
4 changed files with 18 additions and 21 deletions
|
|
@ -51,8 +51,7 @@ class DebugSession( object ):
|
|||
self._logger.info( "API is: {}".format( api_prefix ) )
|
||||
self._logger.info( 'VIMSPECTOR_HOME = %s', VIMSPECTOR_HOME )
|
||||
self._logger.info( 'gadgetDir = %s',
|
||||
install.GetGadgetDir( VIMSPECTOR_HOME,
|
||||
install.GetOS() ) )
|
||||
install.GetGadgetDir( VIMSPECTOR_HOME ) )
|
||||
|
||||
self._uiTab = None
|
||||
self._stackTraceView = None
|
||||
|
|
@ -91,7 +90,7 @@ class DebugSession( object ):
|
|||
configurations = {}
|
||||
adapters = {}
|
||||
|
||||
glob.glob( install.GetGadgetDir( VIMSPECTOR_HOME, install.GetOS() ) )
|
||||
glob.glob( install.GetGadgetDir( VIMSPECTOR_HOME ) )
|
||||
for gadget_config_file in PathsToAllGadgetConfigs( VIMSPECTOR_HOME,
|
||||
current_file ):
|
||||
self._logger.debug( f'Reading gadget config: {gadget_config_file}' )
|
||||
|
|
@ -192,7 +191,7 @@ class DebugSession( object ):
|
|||
'dollar': '$', # HACK. Hote '$$' also works.
|
||||
'workspaceRoot': self._workspace_root,
|
||||
'workspaceFolder': self._workspace_root,
|
||||
'gadgetDir': install.GetGadgetDir( VIMSPECTOR_HOME, install.GetOS() ),
|
||||
'gadgetDir': install.GetGadgetDir( VIMSPECTOR_HOME ),
|
||||
'file': current_file,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ from vimspector import install, utils
|
|||
def SetUpDebugpy( wait=False, port=5678 ):
|
||||
sys.path.insert(
|
||||
1,
|
||||
os.path.join( install.GetGadgetDir( utils.GetVimspectorBase(),
|
||||
install.GetOS() ),
|
||||
os.path.join( install.GetGadgetDir( utils.GetVimspectorBase() ),
|
||||
'debugpy',
|
||||
'build',
|
||||
'lib' ) )
|
||||
|
|
|
|||
|
|
@ -38,18 +38,16 @@ def MakeInstallDirs( vimspector_base ):
|
|||
mkdirs( GetConfigDirForFiletype( vimspector_base, '_all' ) )
|
||||
|
||||
|
||||
def GetGadgetDir( vimspector_base, OS ):
|
||||
return os.path.join( os.path.abspath( vimspector_base ), 'gadgets', OS )
|
||||
def GetGadgetDir( vimspector_base ):
|
||||
return os.path.join( os.path.abspath( vimspector_base ), 'gadgets', GetOS() )
|
||||
|
||||
|
||||
def GetGadgetConfigFile( vimspector_base ):
|
||||
return os.path.join( GetGadgetDir( vimspector_base, GetOS() ),
|
||||
'.gadgets.json' )
|
||||
return os.path.join( GetGadgetDir( vimspector_base ), '.gadgets.json' )
|
||||
|
||||
|
||||
def GetGadgetConfigDir( vimspector_base ):
|
||||
return os.path.join( GetGadgetDir( vimspector_base, GetOS() ),
|
||||
'.gadgets.d' )
|
||||
return os.path.join( GetGadgetDir( vimspector_base ), '.gadgets.d' )
|
||||
|
||||
|
||||
def GetConfigDirForFiletype( vimspector_base, filetype ):
|
||||
|
|
|
|||
|
|
@ -163,9 +163,11 @@ def InstallGagdet( name, gadget, failed, all_adapters ):
|
|||
install.GetOS(),
|
||||
name ) )
|
||||
|
||||
destination = os.path.join( _GetGadgetDir(),
|
||||
'download',
|
||||
name, v[ 'version' ] )
|
||||
destination = os.path.join(
|
||||
install.GetGadgetDir( options.vimspector_base ),
|
||||
'download',
|
||||
name,
|
||||
v[ 'version' ] )
|
||||
|
||||
url = string.Template( gadget[ 'download' ][ 'url' ] ).substitute( v )
|
||||
|
||||
|
|
@ -185,7 +187,10 @@ def InstallGagdet( name, gadget, failed, all_adapters ):
|
|||
url = string.Template( gadget[ 'repo' ][ 'url' ] ).substitute( v )
|
||||
ref = string.Template( gadget[ 'repo' ][ 'ref' ] ).substitute( v )
|
||||
|
||||
destination = os.path.join( _GetGadgetDir(), 'download', name )
|
||||
destination = os.path.join(
|
||||
install.GetGadgetDir( options.vimspector_base ),
|
||||
'download',
|
||||
name )
|
||||
CloneRepoTo( url, ref, destination )
|
||||
root = destination
|
||||
|
||||
|
|
@ -385,17 +390,13 @@ def ExtractZipTo( file_path, destination, format ):
|
|||
subprocess.check_call( [ 'tar', 'zxvf', file_path ] )
|
||||
|
||||
|
||||
def _GetGadgetDir():
|
||||
return install.GetGadgetDir( options.vimspector_base, install.GetOS() )
|
||||
|
||||
|
||||
def MakeExtensionSymlink( name, root ):
|
||||
MakeSymlink( name, os.path.join( root, 'extension' ) ),
|
||||
|
||||
|
||||
def MakeSymlink( link, pointing_to, in_folder = None ):
|
||||
if not in_folder:
|
||||
in_folder = _GetGadgetDir()
|
||||
in_folder = install.GetGadgetDir( options.vimspector_base )
|
||||
|
||||
RemoveIfExists( os.path.join( in_folder, link ) )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue