Skip to content

Commit

Permalink
Fix #178: Change downlaod http to https
Browse files Browse the repository at this point in the history
  • Loading branch information
jyapayne committed Jan 7, 2017
1 parent 48cc908 commit 08f6305
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion command_line.py
Expand Up @@ -595,7 +595,8 @@ def extract_files(self):
try:
if setting.value:
extract_path = get_data_path('files/'+setting.name)
setting.extract(extract_path, version, sdk_build)
setting.extract(extract_path, version, save_file_path,
sdk_build)

self.progress_text += '.'

Expand Down
2 changes: 1 addition & 1 deletion files/settings.cfg
@@ -1,4 +1,4 @@
base_url='http://dl.nwjs.io/v{}/'
base_url='https://dl.nwjs.io/v{}/'
win_32_dir_prefix = 'nwjs-v{}-win-ia32'
mac_32_dir_prefix = 'nwjs-v{}-osx-ia32'
linux_32_dir_prefix = 'nwjs-v{}-linux-ia32'
Expand Down
6 changes: 5 additions & 1 deletion main.py
Expand Up @@ -763,7 +763,11 @@ def download_file(self, path, setting):
return

# Download in HTTP mode
mode = QHttp.ConnectionModeHttp
if path.startswith('https'):
mode = QHttp.ConnectionModeHttps
else:
mode = QHttp.ConnectionModeHttp

port = url.port()

if port == -1:
Expand Down
5 changes: 3 additions & 2 deletions util_classes.py
Expand Up @@ -449,11 +449,12 @@ def set_extra_attributes_from_keyword_args(self, **kwargs):
for undefined_key, undefined_value in kwargs.items():
setattr(self, undefined_key, undefined_value)

def extract(self, ex_path, version, sdk_build=False):
def extract(self, ex_path, version, location=None, sdk_build=False):
if os.path.exists(ex_path):
utils.rmtree(ex_path, ignore_errors=True)

path = self.save_file_path(version, sdk_build=sdk_build)
path = location or self.save_file_path(version,
sdk_build=sdk_build)

file = self.extract_class(path,
*self.extract_args)
Expand Down

0 comments on commit 08f6305

Please sign in to comment.