Skip to content
Snippets Groups Projects
Select Git revision
  • 31579e4bf6a7678b3bdbcd86e2d34bdca8e6a325
  • master default protected
  • feature/startup_node_selection
  • hugo/startup_node_selection
  • develop
  • feature/encrypted_comment
  • feature/cesium_plus_pod_2
  • feature/android_api_19
  • Vivakvo/cesium-patch-8
  • gitlab_migration_1
  • dev
  • rml8
  • v1.7.0-rc1
  • v1.6.12
  • v1.6.11
  • v1.6.10
  • v1.6.9
  • v1.6.8
  • v1.6.7
  • v1.6.6
  • v1.6.5
  • v1.6.4
  • v1.6.3
  • v1.6.2
  • v1.6.2-alpha
  • v1.6.1
  • v1.6.0
  • v1.5.12
  • v1.5.11
  • v1.5.10
  • v1.5.9
  • v1.5.8
32 results

config.js

Blame
  • Forked from clients / Cesium-grp / Cesium
    Source project has a limited visibility.
    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', 'sakia', '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()