Skip to content

Commit

Permalink
REVERT CHANGES
Browse files Browse the repository at this point in the history
  • Loading branch information
mouuff committed Dec 9, 2019
1 parent b6c674e commit 44531bd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 138 deletions.
24 changes: 0 additions & 24 deletions examples/test_gitlab_gui bitbucket.py

This file was deleted.

1 change: 0 additions & 1 deletion iquail/solution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
from .solution_zip import SolutionZip
from .solution_packed import SolutionPacked
from .solution_gitlab import SolutionGitLab
from .solution_bitbucket import SolutionBitBucket
102 changes: 0 additions & 102 deletions iquail/solution/solution_bitbucket.py

This file was deleted.

22 changes: 16 additions & 6 deletions iquail/solution/solution_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def _parse_gitlab_url(self):
(repo_owner, repo_name)
"""
re1 = '.*?' # Non-greedy match on filler
re2 = '(?:[a-z][a-z0-9_]*)' # Uninteresting: var
re2 = '(?:[a-z][a-z]+)' # Uninteresting: word
re3 = '.*?' # Non-greedy match on filler
re4 = '(?:[a-z][a-z0-9_]*)' # Uninteresting: var
re4 = '(?:[a-z][a-z]+)' # Uninteresting: word
re5 = '.*?' # Non-greedy match on filler
re6 = '(?:[a-z][a-z0-9_]*)' # Uninteresting: var
re6 = '(?:[a-z][a-z]+)' # Uninteresting: word
re7 = '.*?' # Non-greedy match on filler
re8 = '((?:[a-z][a-z0-9_]*))' # Variable Name 1
re8 = '((?:[a-z][a-z]+))' # Word 1
re9 = '.*?' # Non-greedy match on filler
re10 = '((?:[a-z][a-z0-9_]*))' # Variable Name 2
re10 = '((?:[a-z][a-z0-9_]*))' # Variable Name 1

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

@cache_result
def _get_releases(self):
Expand Down Expand Up @@ -114,3 +114,13 @@ def walk(self):

def retrieve_file(self, relative_path):
return self._solution_zip.retrieve_file(relative_path)


p = SolutionGitLab(
"cmder_mini.zip", "https://gitlab.com/Artous/quail_cmder_test", 14938606)
url = p._get_release_url()
print("release url : " + url)

url = p._get_zip_url(p._get_last_release())
print("zip url : " + url)

9 changes: 4 additions & 5 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ def test_rerun_as_admin(self):
ctypes.windll.shell32.ShellExecuteW = MagicMock()
mock = ctypes.windll.shell32.ShellExecuteW
return # TODO test disabled
sys.argv = [os.path.abspath('./test.py')]
sys.argv = ['./test.py']
misc.rerun_as_admin(False)
mock.assert_called_with('sudo', ['sudo', os.path.abspath('./test.py')])
sys.argv = [os.path.abspath('./bin')]
misc.rerun_as_admin(True, './bin')
mock.assert_called_with('pkexec', ['pkexec', './dir/bin', '--iquail_install_polkit'])
mock.assert_called_with('sudo', ['sudo', './test.py'])
misc.rerun_as_admin(True, '/dir/', '/bin')
mock.assert_called_with('pkexec', ['pkexec', '/bin', '--iquail_path', '/dir/'])

0 comments on commit 44531bd

Please sign in to comment.