Skip to content

Commit ddb2889

Browse files
committed
Code cleanup
1 parent 54a779f commit ddb2889

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mbed/mbed.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
mbed_sdk_tools_url = 'https://mbed.org/users/mbed_official/code/mbed-sdk-tools'
127127

128128
# a list of public SCM service (github/butbucket) which support http, https and ssh schemas
129-
public_repo_services = ['bitbucket.org', 'github.com', 'gitlab.com']
129+
public_scm_services = ['bitbucket.org', 'github.com', 'gitlab.com']
130130

131131

132132
# verbose logging
@@ -1096,7 +1096,7 @@ def isurl(cls, url):
10961096

10971097
@classmethod
10981098
def isinsecure(cls, url):
1099-
up = urlparse(url, 'https')
1099+
up = urlparse(url)
11001100
return not up or not up.scheme or up.scheme not in ['http', 'https', 'ssh', 'git'] or (up.port and int(up.port) not in [22, 80, 443])
11011101

11021102
@property
@@ -1178,7 +1178,7 @@ def remove(self, dest, *args, **kwargs):
11781178
pass
11791179
return self.scm.remove(dest, *args, **kwargs)
11801180

1181-
def clone(self, url, path, rev=None, depth=None, protocol=None, insecure=False, **kwargs):
1181+
def clone(self, url, path, rev=None, depth=None, protocol=None, **kwargs):
11821182
# Sorted so repositories that match urls are attempted first
11831183
info("Trying to guess source control management tool. Supported SCMs: %s" % ', '.join([s.name for s in scms.values()]))
11841184
for _, scm in scms.items():
@@ -1246,14 +1246,14 @@ def write(self):
12461246
if os.path.isfile(self.lib):
12471247
with open(self.lib) as f:
12481248
lib_repo = Repo.fromurl(f.read().strip())
1249-
if (formaturl(lib_repo.url, 'https') == formaturl(url, 'https') # match URLs in common format (https)
1250-
and (lib_repo.rev == self.rev # match revs, even if rev is None (valid for repos with no revisions)
1249+
if (formaturl(lib_repo.url, 'https') == formaturl(url, 'https') # match URLs in common schema (https)
1250+
and (lib_repo.rev == self.rev # match revs, even if rev is None (valid for repos with no revisions)
12511251
or (lib_repo.rev and self.rev
12521252
and lib_repo.rev == self.rev[0:len(lib_repo.rev)]))): # match long and short rev formats
12531253
#print self.name, 'unmodified'
12541254
return
12551255

1256-
if up.hostname in public_repo_services:
1256+
if up.hostname in public_scm_services:
12571257
# Safely convert repo URL to https schema if this is a public SCM service (github/butbucket), supporting all schemas.
12581258
# This allows anonymous cloning of public repos without having to have ssh keys and associated accounts at github/bitbucket/etc.
12591259
# Without this anonymous users will get clone errors with ssh repository links even if the repository is public.

0 commit comments

Comments
 (0)