-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,265 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
echo "Branch: %APPVEYOR_REPO_BRANCH%" | ||
echo "Pull Request: %APPVEYOR_PULL_REQUEST_NUMBER%" | ||
if %APPVEYOR_REPO_BRANCH% == "master" ( | ||
for /r %%i in (dist/*) do echo %%i | ||
|
||
for /r %%i in (dist/*) do echo %%i | ||
|
||
for %%f in (dist/*) do ( | ||
curl.exe -i -X POST "%DEPLOY_UPLOAD_URL%/%APPVEYOR_REPO_BRANCH%/Windows?token=%TOKEN%" ^ | ||
-F "file=@dist/%%f" ^ | ||
--keepalive-time 2 | ||
for %%f in (dist/*) do ( | ||
curl.exe -i -X POST "%DEPLOY_UPLOAD_URL%/%APPVEYOR_REPO_BRANCH%/Windows?token=%TOKEN%" ^ | ||
-F "file=@dist/%%f" ^ | ||
--keepalive-time 2 | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,4 @@ exe = EXE(pyz, | |
strip=False, | ||
upx=True, | ||
console=False, | ||
icon="img/app.ico") | ||
icon="img/256x256.ico") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,4 @@ exe = EXE(pyz, | |
strip=False, | ||
upx=True, | ||
console=False, | ||
icon="img/app.ico") | ||
icon="img/256x256.ico") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,79 @@ | ||
import asyncio | ||
import os | ||
import sys | ||
import platform | ||
import re | ||
from quamash import QEventLoop | ||
from PyQt5 import QtGui, QtCore | ||
from PyQt5.QtWidgets import QApplication | ||
from util import get_platform | ||
|
||
ICON_SIZES = (16, 32, 48, 64, 256) | ||
|
||
app = QApplication(sys.argv) | ||
loop = QEventLoop(app) | ||
asyncio.set_event_loop(loop) | ||
GLOBAL_CONTEXT = { | ||
'platform': platform.system(), | ||
'platform': get_platform(), | ||
'executable': os.path.basename(sys.executable) | ||
} | ||
|
||
vars_regex = re.compile('{(.*?)}') | ||
|
||
|
||
def get_app(): | ||
g = globals() | ||
if g.get('app') is None: | ||
g['app'] = QApplication(sys.argv) | ||
|
||
return app | ||
|
||
|
||
def get_loop(): | ||
g = globals() | ||
if g.get('loop') is None: | ||
if g.get('app') is None: | ||
raise NameError("cannot create loop without an app to bind it to.") | ||
new_loop = QEventLoop(app) | ||
asyncio.set_event_loop(new_loop) | ||
g['loop'] = new_loop | ||
|
||
return loop | ||
|
||
|
||
def set_app_icon(): | ||
# config relies on common, and this function in common relies on config. | ||
# gotta break the import loop somewhere, so this seems like a good place. | ||
# might be more preferrable to make a dummy config attribute and have the | ||
# launcher's __init__.py set up a circular link between both modules. | ||
# that might not work well when running tests though... | ||
import config | ||
g = globals() | ||
|
||
if g.get('app') is None: | ||
raise NameError("'app' is not defined. cannot set its icon.") | ||
# load all the icons from the img folder into a QIcon object | ||
app_icon = QtGui.QIcon() | ||
for size in ICON_SIZES: | ||
app_icon.addFile( | ||
os.path.join( | ||
config.RESOURCE_DIR, 'img', '%sx%s.ico' % (size, size)), | ||
QtCore.QSize(size, size)) | ||
|
||
g['app_icon'] = app_icon | ||
app.setWindowIcon(app_icon) | ||
|
||
|
||
def sanitize_url(url): | ||
return url.lower().replace(' ', '-') | ||
|
||
|
||
def inject_variables(path_format, vars_obj=GLOBAL_CONTEXT): | ||
matches = vars_regex.findall(path_format) | ||
path = path_format | ||
vars_is_dict = isinstance(vars_obj, dict) | ||
for match in matches: | ||
target = '{%s}' % match | ||
if isinstance(vars_obj, dict) and match in vars_obj: | ||
path = path.replace(target, str(vars_obj[match])) | ||
if vars_is_dict: | ||
replacement = vars_obj.get(match) | ||
else: | ||
replacement = getattr(vars_obj, match, None) | ||
if replacement is not None: | ||
path = path.replace(target, str(replacement)) | ||
if replacement is None: | ||
continue | ||
path = path.replace('{%s}' % match, str(replacement)) | ||
return path |
Oops, something went wrong.