mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 20:13:56 -06:00
Some style fixing, and added a test script to test for the major style violations.
This commit is contained in:
parent
6d0e31aa8d
commit
0b3ffc452e
1 changed files with 29 additions and 29 deletions
58
setup.py
58
setup.py
|
@ -10,32 +10,32 @@ import site
|
||||||
includes = ['sip', 'ctypes', 'UM', 'PyQt5.QtNetwork', 'PyQt5._QOpenGLFunctions_2_0', 'serial', 'Arcus', 'google', 'google.protobuf', 'google.protobuf.descriptor', 'xml.etree', 'xml.etree.ElementTree']
|
includes = ['sip', 'ctypes', 'UM', 'PyQt5.QtNetwork', 'PyQt5._QOpenGLFunctions_2_0', 'serial', 'Arcus', 'google', 'google.protobuf', 'google.protobuf.descriptor', 'xml.etree', 'xml.etree.ElementTree']
|
||||||
# Include all the UM modules in the includes. As py2exe fails to properly find all the dependencies due to the plugin architecture.
|
# Include all the UM modules in the includes. As py2exe fails to properly find all the dependencies due to the plugin architecture.
|
||||||
for dirpath, dirnames, filenames in os.walk('../UM'):
|
for dirpath, dirnames, filenames in os.walk('../UM'):
|
||||||
if '__' in dirpath:
|
if '__' in dirpath:
|
||||||
continue
|
continue
|
||||||
dirpath = dirpath.split(os.path.sep)
|
dirpath = dirpath.split(os.path.sep)
|
||||||
dirpath[0] = 'UM'
|
dirpath[0] = 'UM'
|
||||||
module_name = '.'.join(dirpath)
|
module_name = '.'.join(dirpath)
|
||||||
if os.path.isfile('../' + os.path.sep.join(dirpath) + '/__init__.py'):
|
if os.path.isfile('../' + os.path.sep.join(dirpath) + '/__init__.py'):
|
||||||
includes += [module_name]
|
includes += [module_name]
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
if '__' in filename or not filename.endswith('.py'):
|
if '__' in filename or not filename.endswith('.py'):
|
||||||
continue
|
continue
|
||||||
includes += [module_name + '.' + os.path.splitext(filename)[0]]
|
includes += [module_name + '.' + os.path.splitext(filename)[0]]
|
||||||
|
|
||||||
|
|
||||||
print('Removing previous distribution package')
|
print('Removing previous distribution package')
|
||||||
shutil.rmtree('dist', True)
|
shutil.rmtree('dist', True)
|
||||||
|
|
||||||
setup(name="Cura",
|
setup(name="Cura",
|
||||||
version="2.0",
|
version="2.0",
|
||||||
author="Ultimaker",
|
author="Ultimaker",
|
||||||
author_email="d.braam@ultimaker.com",
|
author_email="d.braam@ultimaker.com",
|
||||||
url="http://software.ultimaker.com/",
|
url="http://software.ultimaker.com/",
|
||||||
license="GNU AFFERO GENERAL PUBLIC LICENSE (AGPL)",
|
license="GNU AFFERO GENERAL PUBLIC LICENSE (AGPL)",
|
||||||
scripts=["printer.py", "PrinterApplication.py"],
|
scripts=["printer.py", "PrinterApplication.py"],
|
||||||
#windows=[{"script": "printer.py", "dest_name": "Cura"}],
|
#windows=[{"script": "printer.py", "dest_name": "Cura"}],
|
||||||
console=[{"script": "printer.py"}],
|
console=[{"script": "printer.py"}],
|
||||||
options={"py2exe": {"skip_archive": False, "includes": includes}})
|
options={"py2exe": {"skip_archive": False, "includes": includes}})
|
||||||
|
|
||||||
print('Coping Cura plugins.')
|
print('Coping Cura plugins.')
|
||||||
shutil.copytree('../plugins', 'dist/plugins')
|
shutil.copytree('../plugins', 'dist/plugins')
|
||||||
|
@ -46,13 +46,13 @@ shutil.copytree('../resources', 'dist/resources')
|
||||||
print('Coping resources.')
|
print('Coping resources.')
|
||||||
shutil.copytree('../UM/Qt/qml/UM', 'dist/qml/UM')
|
shutil.copytree('../UM/Qt/qml/UM', 'dist/qml/UM')
|
||||||
for site_package in site.getsitepackages():
|
for site_package in site.getsitepackages():
|
||||||
qt_origin_path = os.path.join(site_package, 'PyQt5')
|
qt_origin_path = os.path.join(site_package, 'PyQt5')
|
||||||
if os.path.isdir(qt_origin_path):
|
if os.path.isdir(qt_origin_path):
|
||||||
print('Coping PyQt5 plugins from: %s' % qt_origin_path)
|
print('Coping PyQt5 plugins from: %s' % qt_origin_path)
|
||||||
shutil.copytree(os.path.join(qt_origin_path, 'plugins'), 'dist/PyQt5/plugins')
|
shutil.copytree(os.path.join(qt_origin_path, 'plugins'), 'dist/PyQt5/plugins')
|
||||||
print('Coping PyQt5 QtQuick from: %s' % qt_origin_path)
|
print('Coping PyQt5 QtQuick from: %s' % qt_origin_path)
|
||||||
shutil.copytree(os.path.join(qt_origin_path, 'qml/QtQuick'), 'dist/qml/QtQuick')
|
shutil.copytree(os.path.join(qt_origin_path, 'qml/QtQuick'), 'dist/qml/QtQuick')
|
||||||
shutil.copytree(os.path.join(qt_origin_path, 'qml/QtQuick.2'), 'dist/qml/QtQuick.2')
|
shutil.copytree(os.path.join(qt_origin_path, 'qml/QtQuick.2'), 'dist/qml/QtQuick.2')
|
||||||
print('Coping PyQt5 svg library from: %s' % qt_origin_path)
|
print('Coping PyQt5 svg library from: %s' % qt_origin_path)
|
||||||
shutil.copy(os.path.join(qt_origin_path, 'Qt5Svg.dll'), 'dist/Qt5Svg.dll')
|
shutil.copy(os.path.join(qt_origin_path, 'Qt5Svg.dll'), 'dist/Qt5Svg.dll')
|
||||||
os.rename('dist/printer.exe', 'dist/Cura.exe')
|
os.rename('dist/printer.exe', 'dist/Cura.exe')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue