Skip to content
Snippets Groups Projects
Select Git revision
  • 13c1f9270ccfeb64c5017ea680ebd7581f1cc64a
  • dev default protected
  • release/1.9.1 protected
  • pini-1.8-docker
  • pini-sync-onlypeers
  • duniter-v2s-issue-123-industrialize-releases
  • feature/build-aarch64-nodejs16
  • release/1.8 protected
  • pini-docker
  • ci_tags
  • fix/1448/1.8/txs_not_stored
  • feature/node-20
  • fix/1441/node_summary_with_storage
  • fix/1442/improve_bma_tx_history
  • feature/wotwizard-1.8
  • release/1.9 protected
  • 1.7 protected
  • feature/docker-set-latest protected
  • feature/fast-docker-build-1.8.4
  • fast-docker-build protected
  • feature/dump-distance
  • v1.8.7 protected
  • v1.8.7-rc4 protected
  • v1.8.7-rc3 protected
  • v1.8.7-rc2 protected
  • v1.8.7-rc1 protected
  • v1.8.6 protected
  • v1.7.23 protected
  • v1.8.5 protected
  • v1.8.4 protected
  • v1.8.3 protected
  • v1.8.2 protected
  • v1.8.1 protected
  • v1.8.0 protected
  • v1.8.0-rc1 protected
  • v1.8.0-beta5 protected
  • v1.8.0-beta4 protected
  • v1.8.0-beta3 protected
  • v1.8.0-beta2 protected
  • v1.8.0-beta protected
  • v1.7.21 protected
41 results

fork.pu

Blame
  • gen_resources.py 1.61 KiB
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    import sys, os, multiprocessing, subprocess
    
    resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res'))
    gen_ui = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src', 'cutecoin', 'gen_resources'))
    gen_resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))
    
    def convert_ui(args, **kwargs):
        subprocess.call(args, **kwargs)
    
    def build_resources():
        try:
            to_process = []
            for root, dirs, files in os.walk(resources):
                for f in files:
                    if f.endswith('.ui'):
                        source = os.path.join(root, f)
                        dest = os.path.join(gen_ui, os.path.splitext(os.path.basename(source))[0]+'_uic.py')
                        exe = 'pyuic5'
                    elif f.endswith('.qrc'):
                        source = os.path.join(root, f)
                        dest = os.path.join(gen_resources, os.path.splitext(os.path.basename(source))[0]+'_rc.py')
                        exe = 'pyrcc5'
                    else:
                        continue
                    print(source + " >> " + dest)
                    to_process.append([exe, '-o', dest, source])
    
            if sys.platform.startswith('win'):
                # doing this in parallel on windows will crash your computer
                [convert_ui(args, shell=True) for args in to_process]
            else:
                pool = multiprocessing.Pool()
                pool.map(convert_ui, to_process)
        except EnvironmentError:
            print("""\
    Warning: PyQt5 development utilities (pyuic5 and pyrcc5) not found
    Unable to install praxes' graphical user interface
    """)
    
    build_resources()