Compare commits

...

5 Commits

Author SHA1 Message Date
KatKatKateryna 07fe49a1f8 Merge pull request #48 from specklesystems/kate/2.11-fixes
missing value of 'Speckle_ID' for received GIS features
2023-01-11 20:34:12 +08:00
KatKatKateryna 6f90081af7 linting 2023-01-11 20:29:40 +08:00
KatKatKateryna 67911fdb5d typo 2023-01-11 19:32:50 +08:00
KatKatKateryna a9e48db570 manual install 2.11.0; patching error fixed 2023-01-11 19:21:40 +08:00
KatKatKateryna d284c5415a missing value of 'Speckle_ID' for received GIS features 2023-01-11 19:11:20 +08:00
4 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ def patch_installer(tag):
with open(fileName, "r") as file:
lines = file.readlines()
for i, line in enumerate(lines):
if "-py3-none-any.whl" in line:
if "-py3-none-any.whl" in line and '.sort' not 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]
@@ -17,10 +17,10 @@ pythonPath = os.getenv('APPDATA').replace("\\Roaming","") + r"\Local\ESRI\conda\
def installToolbox(newExec: str):
print("Installing Speckle Toolbox")
mypath = os.path.dirname(__file__)
onlyfiles = [f for f in listdir(mypath) if (isfile(join(mypath, f)) and "-py3-none-any.whl" in str(f))]
onlyfiles = [f for f in listdir(mypath) if (isfile(join(mypath, f)) and "-2.11.0-py3-none-any.whl" in str(f))]
onlyfiles.sort(key = lambda x: int(x.replace("speckle_toolbox-","").replace("-py3-none-any.whl","").split(".")[1]) )
whl_file = onlyfiles[len(onlyfiles)-1]
#whl_file = os.path.join(os.path.dirname(__file__), "speckle_toolbox-2.9.4-py3-none-any.whl" )
#whl_file = os.path.join(os.path.dirname(__file__), "speckle_toolbox-2.11.0-py3-none-any.whl" )
subprocess_call([newExec, '-m','pip','install','--upgrade', '--force-reinstall', whl_file])
return
@@ -88,9 +88,14 @@ def featureToNative(feature: Base, fields: dict, geomType: str, sr: arcpy.Spatia
return None
for key, variant in fields.items():
try: value = feature[key]
except:
if key == 'Speckle_ID': value = feature['id']
else:
arcpy.AddWarning(f'Field {key} not found')
return None
value = feature[key]
if variant == "TEXT": value = str(feature[key])
if variant == "TEXT": value = str(value)
if variant == getVariantFromValue(value) and value != "NULL" and value != "None":
feat.update({key: value})
else: