Merge pull request #289 from ccordoba12/fix-generating-assets

Fix generating assets per operating system
This commit is contained in:
Daniel Pizetta
2021-07-19 18:48:42 -03:00
committed by GitHub
2 changed files with 11 additions and 7 deletions
+7 -4
View File
@@ -40,6 +40,9 @@ def run_process(args, palette):
main_dir = os.path.join(PACKAGE_PATH, palette.ID)
os.chdir(main_dir)
# Shell kwarg to pass to subprocess.
shell = True if os.name == 'nt' else False
for qrc_file in glob.glob('*.qrc'):
# get name without extension
filename = os.path.splitext(qrc_file)[0]
@@ -64,28 +67,28 @@ def run_process(args, palette):
if args.create in ['pyqt', 'pyqtgraph', 'all']:
print("Compiling for PyQt4 ...")
try:
call(['pyrcc4', '-py3', qrc_file, '-o', py_file_pyqt], shell=True)
call(['pyrcc4', '-py3', qrc_file, '-o', py_file_pyqt], shell=shell)
except FileNotFoundError:
print("You must install pyrcc4")
if args.create in ['pyqt5', 'qtpy', 'all']:
print("Compiling for PyQt5 ...")
try:
call(['pyrcc5', qrc_file, '-o', py_file_pyqt5], shell=True)
call(['pyrcc5', qrc_file, '-o', py_file_pyqt5], shell=shell)
except FileNotFoundError:
print("You must install pyrcc5")
if args.create in ['pyside', 'all']:
print("Compiling for PySide ...")
try:
call(['pyside-rcc', '-py3', qrc_file, '-o', py_file_pyside], shell=True)
call(['pyside-rcc', '-py3', qrc_file, '-o', py_file_pyside], shell=shell)
except FileNotFoundError:
print("You must install pyside-rcc")
if args.create in ['pyside2', 'all']:
print("Compiling for PySide 2...")
try:
call(['pyside2-rcc', qrc_file, '-o', py_file_pyside2], shell=True)
call(['pyside2-rcc', qrc_file, '-o', py_file_pyside2], shell=shell)
except FileNotFoundError:
print("You must install pyside2-rcc")
+4 -3
View File
@@ -34,6 +34,7 @@ def main():
styled = None
no_styled = None
themes = {'Styled': styled, 'No styled': no_styled}
shell = True if os.name == 'nt' else False
while True:
for theme_name, theme_process in themes.items():
try:
@@ -49,16 +50,16 @@ def main():
# Process qrc files
process_qrc = os.path.join(SCRIPTS_PATH, '../qdarkstyle/utils/__main__.py')
call(['python', process_qrc], shell=True)
call(['python', process_qrc], shell=shell)
# Show window
example = os.path.join(SCRIPTS_PATH, '../qdarkstyle/example/__main__.py')
# Open styled window
styled = call(['python', example, '--palette', palette] + sys.argv[1:], shell=True)
styled = call(['python', example, '--palette', palette] + sys.argv[1:], shell=shell)
# Open unstyled window
no_styled = call(['python', example, '--palette', 'none'] + sys.argv[1:], shell=True)
no_styled = call(['python', example, '--palette', 'none'] + sys.argv[1:], shell=shell)
if styled or no_styled:
print('Unf! It not worked! Please, check the error(s).')