Skip to content

Commit 9f07c88

Browse files
committed
Changes for building rpms
1 parent 817264e commit 9f07c88

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

data/rpm_templates/XlsxWriter.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%define name XlsxWriter
1+
%define name xlsxwriter
22
%define version {version}
3-
%define unmangled_name XlsxWriter
3+
%define unmangled_name xlsxwriter
44
%define unmangled_version {version}
55
%define release 1
66

l2tdevtools/download_helpers/interface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22
"""Download helper object implementations."""
33

4+
import http.client
45
import logging
56
import os
67

@@ -51,7 +52,7 @@ def DownloadFile(self, download_url):
5152
with open(filename, 'wb') as file_object:
5253
file_object.write(page_content)
5354

54-
except urllib_error.URLError as exception:
55+
except (http.client.InvalidURL, urllib_error.URLError) as exception:
5556
logging.warning(
5657
'Unable to download URL: {0:s} with error: {1!s}'.format(
5758
download_url, exception))

l2tdevtools/download_helpers/pypi.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def GetLatestVersion(self, project_name, version_definition):
113113
r'{0:s}-([\d\.\!]*(post\d+)?)\.(tar\.bz2|tar\.gz|zip)"').format(
114114
self._source_name)
115115

116-
print("X:", expression_string)
117116
matches = re.findall(expression_string, page_content, flags=re.IGNORECASE)
118117
if not matches:
119118
return None
@@ -140,11 +139,11 @@ def GetDownloadURL(self, project_name, project_version):
140139
return None
141140

142141
# The format of the project download URL is:
143-
# https://files.pythonhosted.org/packages/.*/.*/.*/
142+
# https://files.pythonhosted.org/packages/[0-9a-f]*/[0-9a-f]*/[0-9a-f]*/
144143
# {project name}-{version}.{extension}
145144
expression_string = (
146-
'(https://files.pythonhosted.org/packages/.*/.*/.*/'
147-
'{0:s}-{1!s}[.](tar[.]bz2|tar[.]gz|zip))').format(
145+
'(https://files.pythonhosted.org/packages/[0-9a-f]*/[0-9a-f]*/'
146+
'[0-9a-f]*/{0:s}-{1!s}[.](tar[.]bz2|tar[.]gz|zip))').format(
148147
self._source_name, project_version)
149148
matches = re.findall(expression_string, page_content, flags=re.IGNORECASE)
150149

0 commit comments

Comments
 (0)