Skip to content

Commit

Permalink
Merge pull request #34 from puremourning/lgtm
Browse files Browse the repository at this point in the history
Fix flake8 errors and lgtm errors in install_gadget.py
  • Loading branch information
mergify[bot] authored Jun 8, 2019
2 parents 10baf4d + ca4cb8a commit 3b854a8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions install_gadget.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
'all': {
'file_name': 'vscode-mono-debug.vsix',
'version': '0.15.8',
'checksum': '723eb2b621b99d65a24f215cb64b45f5fe694105613a900a03c859a62a810470',
'checksum':
'723eb2b621b99d65a24f215cb64b45f5fe694105613a900a03c859a62a810470',
}
},
'vscode-bash-debug': {
Expand All @@ -136,6 +137,7 @@
}
}


@contextlib.contextmanager
def CurrentWorkingDir( d ):
cur_d = os.getcwd()
Expand Down Expand Up @@ -200,7 +202,7 @@ def InstallTclProDebug( name, root ):


with CurrentWorkingDir( os.path.join( root, 'lib', 'tclparser' ) ):
subprocess.check_call( configure )
subprocess.check_call( configure )
subprocess.check_call( [ 'make' ] )

MakeSymlink( gadget_dir, name, root )
Expand Down Expand Up @@ -274,15 +276,15 @@ def RemoveIfExists( destination ):
# other than crappy code. Let's do it's job for it.
class ModePreservingZipFile( zipfile.ZipFile ):
def extract( self, member, path = None, pwd = None ):
if not isinstance(member, zipfile.ZipInfo):
member = self.getinfo(member)
if not isinstance( member, zipfile.ZipInfo ):
member = self.getinfo( member )

if path is None:
path = os.getcwd()

ret_val = self._extract_member(member, path, pwd)
ret_val = self._extract_member( member, path, pwd )
attr = member.external_attr >> 16
os.chmod(ret_val, attr)
os.chmod( ret_val, attr )
return ret_val


Expand Down Expand Up @@ -324,6 +326,7 @@ def CloneRepoTo( url, ref, destination ):
subprocess.check_call( [ 'git', 'clone', url, destination ] )
subprocess.check_call( [ 'git', '-C', destination, 'checkout', ref ] )


OS = install.GetOS()
gadget_dir = install.GetGadgetDir( os.path.dirname( __file__ ), OS )

Expand Down Expand Up @@ -388,7 +391,7 @@ def CloneRepoTo( url, ref, destination ):
root = os.path.join( destination, 'root' )
ExtractZipTo( file_path,
root,
format = gadget[ 'download' ].get( 'format', 'zip' ) )
format = gadget[ 'download' ].get( 'format', 'zip' ) )
elif 'repo' in gadget:
url = string.Template( gadget[ 'repo' ][ 'url' ] ).substitute( v )
ref = string.Template( gadget[ 'repo' ][ 'ref' ] ).substitute( v )
Expand Down

0 comments on commit 3b854a8

Please sign in to comment.