pb_tool zipping settings, plugin_upload script updated; contact email updated; patch file.

This commit is contained in:
KatKatKateryna 2022-11-03 21:17:05 +08:00
Родитель cb0c80f484
Коммит 41ad848ac6
5 изменённых файлов: 84 добавлений и 9 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -115,4 +115,6 @@ scratch.py
settings.json
**/.DS_Store
zip_build
.qt_for_python
.qt_for_python
speckle-sharp-ci-tools*
zip-build*

Просмотреть файл

@ -6,9 +6,9 @@
name=Speckle
qgisMinimumVersion=3.20.2
description=Speckle 2.0 Connector for QGIS
version=2.9.4
version=2.0.99
author=Speckle Systems
email=hello@speckle.systems
email=connectors@speckle.systems
about=
The Speckle QGIS plugin allows you send and receive data from multiple sources to/from several layers in your project, and store their geometry (as well as their contained metadata), in a Speckle server.

73
patch_version.py Normal file
Просмотреть файл

@ -0,0 +1,73 @@
import re
import sys
def patch_installer(tag):
"""Patches the installer with the correct connector version and specklepy version"""
iss_file = "speckle-sharp-ci-tools/qgis.iss"
metadata = "metadata.txt"
#conda_file = "speckle_arcgis_installer/conda_clone_activate.py"
#toolbox_install_file = "speckle_arcgis_installer/toolbox_install.py"
#toolbox_manual_install_file = "speckle_arcgis_installer/toolbox_install_manual.py"
#py_tag = get_specklepy_version()
r'''
with open(iss_file, "r") as file:
lines = file.readlines()
for i, line in enumerate(lines):
if "#define AppVersion " in line:
lines[i] = f'#define AppVersion "{tag.split("-")[0]}"\n'
if "#define AppInfoVersion " in line:
lines[i] = f'#define AppInfoVersion "{tag}"\n'
with open(iss_file, "w") as file:
file.writelines(lines)
print(f"Patched installer with connector v{tag} and specklepy ")
file.close()
'''
with open(metadata, "r") as file:
lines = file.readlines()
for i, line in enumerate(lines):
if "version=" in line:
lines[i] = f'version="{tag.split("-")[0]}"'
break
with open(metadata, "w") as file:
file.writelines(lines)
print(f"Patched whl setup with connector v{tag} and specklepy ")
file.close()
r'''
def whlFileRename(fileName: str):
with open(fileName, "r") as file:
lines = file.readlines()
for i, line in enumerate(lines):
if "-py3-none-any.whl" in line:
p1 = line.split("-py3-none-any.whl")[0].split("-")[0]
p2 = f'{tag.split("-")[0]}'
p3 = line.split("-py3-none-any.whl")[1]
lines[i] = p1+"-"+p2+"-py3-none-any.whl"+p3
with open(fileName, "w") as file:
file.writelines(lines)
print(f"Patched toolbox_installer with connector v{tag} and specklepy ")
file.close()
whlFileRename(conda_file)
whlFileRename(toolbox_install_file)
whlFileRename(toolbox_manual_install_file)
'''
def main():
if len(sys.argv) < 2:
return
tag = sys.argv[1]
if not re.match(r"([0-9]+)\.([0-9]+)\.([0-9]+)", tag):
raise ValueError(f"Invalid tag provided: {tag}")
print(f"Patching version: {tag}")
#patch_connector(tag.split("-")[0]) if I need to edit a connector file
patch_installer(tag)
if __name__ == "__main__":
main()

Просмотреть файл

@ -39,7 +39,7 @@
[plugin]
# Name of the plugin. This is the name of the directory that will
# be created in .qgis2/python/plugins
name: speckle_qgis
name: speckle-qgis
# Full path to where you want your plugin directory copied. If empty,
# the QGIS default path will be used. Don't include the plugin name in
@ -48,10 +48,10 @@ plugin_path:
[files]
# Python files that should be deployed with the plugin
python_files: __init__.py speckle_qgis.py ui/speckle_qgis_dialog.py
python_files: __init__.py speckle_qgis.py resources.py
# The main dialog file that is loaded (not compiled)
main_dialog: ui/speckle_qgis_dialog_base.ui
main_dialog:
# Other ui files for dialogs you create (these will be compiled)
compiled_ui_files:
@ -64,7 +64,7 @@ extras: metadata.txt icon.png
# Other directories to be deployed with the plugin.
# These must be subdirectories under the plugin directory
extra_dirs:
extra_dirs: ui\ speckle\ plugin_utils\
# ISO code(s) for any locales (translations), separated by spaces.
# Corresponding .ts files must exist in the i18n directory

Просмотреть файл

@ -9,8 +9,8 @@ import sys
import getpass
import xmlrpc.client
from optparse import OptionParser
standard_library.install_aliases()
from future.standard_library import install_aliases
install_aliases()
# Configuration
PROTOCOL = 'https'