Skip to content

Commit 44531bd

Browse files
committed
REVERT CHANGES
1 parent b6c674e commit 44531bd

File tree

5 files changed

+20
-138
lines changed

5 files changed

+20
-138
lines changed

examples/test_gitlab_gui bitbucket.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

iquail/solution/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
from .solution_zip import SolutionZip
44
from .solution_packed import SolutionPacked
55
from .solution_gitlab import SolutionGitLab
6-
from .solution_bitbucket import SolutionBitBucket

iquail/solution/solution_bitbucket.py

Lines changed: 0 additions & 102 deletions
This file was deleted.

iquail/solution/solution_gitlab.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ def _parse_gitlab_url(self):
3434
(repo_owner, repo_name)
3535
"""
3636
re1 = '.*?' # Non-greedy match on filler
37-
re2 = '(?:[a-z][a-z0-9_]*)' # Uninteresting: var
37+
re2 = '(?:[a-z][a-z]+)' # Uninteresting: word
3838
re3 = '.*?' # Non-greedy match on filler
39-
re4 = '(?:[a-z][a-z0-9_]*)' # Uninteresting: var
39+
re4 = '(?:[a-z][a-z]+)' # Uninteresting: word
4040
re5 = '.*?' # Non-greedy match on filler
41-
re6 = '(?:[a-z][a-z0-9_]*)' # Uninteresting: var
41+
re6 = '(?:[a-z][a-z]+)' # Uninteresting: word
4242
re7 = '.*?' # Non-greedy match on filler
43-
re8 = '((?:[a-z][a-z0-9_]*))' # Variable Name 1
43+
re8 = '((?:[a-z][a-z]+))' # Word 1
4444
re9 = '.*?' # Non-greedy match on filler
45-
re10 = '((?:[a-z][a-z0-9_]*))' # Variable Name 2
45+
re10 = '((?:[a-z][a-z0-9_]*))' # Variable Name 1
4646

4747
rg = re.compile(re1+re2+re3+re4+re5+re6+re7+re8 +
4848
re9+re10, re.IGNORECASE | re.DOTALL)
@@ -61,7 +61,7 @@ def _get_zip_url(self, release):
6161
m = rg.search(release['description'])
6262
file_path = m.group(1)
6363
owner, repo_name = self._parse_gitlab_url()
64-
return "https://gitlab.com/%s/%s/%s" % (owner, repo_name, file_path)
64+
return "https://gitlab.com/" + owner + '/' + repo_name + '/' + file_path
6565

6666
@cache_result
6767
def _get_releases(self):
@@ -114,3 +114,13 @@ def walk(self):
114114

115115
def retrieve_file(self, relative_path):
116116
return self._solution_zip.retrieve_file(relative_path)
117+
118+
119+
p = SolutionGitLab(
120+
"cmder_mini.zip", "https://gitlab.com/Artous/quail_cmder_test", 14938606)
121+
url = p._get_release_url()
122+
print("release url : " + url)
123+
124+
url = p._get_zip_url(p._get_last_release())
125+
print("zip url : " + url)
126+

tests/test_misc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ def test_rerun_as_admin(self):
5050
ctypes.windll.shell32.ShellExecuteW = MagicMock()
5151
mock = ctypes.windll.shell32.ShellExecuteW
5252
return # TODO test disabled
53-
sys.argv = [os.path.abspath('./test.py')]
53+
sys.argv = ['./test.py']
5454
misc.rerun_as_admin(False)
55-
mock.assert_called_with('sudo', ['sudo', os.path.abspath('./test.py')])
56-
sys.argv = [os.path.abspath('./bin')]
57-
misc.rerun_as_admin(True, './bin')
58-
mock.assert_called_with('pkexec', ['pkexec', './dir/bin', '--iquail_install_polkit'])
55+
mock.assert_called_with('sudo', ['sudo', './test.py'])
56+
misc.rerun_as_admin(True, '/dir/', '/bin')
57+
mock.assert_called_with('pkexec', ['pkexec', '/bin', '--iquail_path', '/dir/'])
5958

0 commit comments

Comments
 (0)