Closed larsdevries closed 8 years ago
Can you please post/share your code?
What version of ArcREST are you using?
This is the code:
`import arcrest, fmeobjects, fme
class FeatureProcessor(object): def init(self):
username = fme.macroValues['AGO_User']
password = fme.macroValues["AGO_Password"]
LayerUrl = fme.macroValues["AGO_URL"]
#PARAMETERS###########################
#generate token#
global AGOtoken
AGOtoken = arcrest.security.AGOLTokenSecurityHandler(username, password)
#generate FeatureLayer#
global FeatureLayer
FeatureLayer = arcrest.agol.services.FeatureLayer(LayerUrl, AGOtoken)
#check FeatureLayer properties#
if FeatureLayer.canModifyLayer == False:
print "Error: layer not editable"
if FeatureLayer.hasAttachments == False:
print "Error: attachments not activated on layer"
#handle all features
def input(self,feature):
FeatureID = str(int(feature.getAttribute("OBJECTID")))
attpath = feature.getAttribute("att.path")
UploadAtt = FeatureLayer.addAttachment(FeatureID, attpath)
AttachID = str(UploadAtt["addAttachmentResult"]["objectId"])
self.pyoutput(feature)
def close(self):
pass`
And I'm using the latest version, only today (3/18/2016) I downloaded the master version.
@larsdevries - issue resolve, please pull the latest.
I am using FME / PythonCaller to add attachments to a service. When I call FeatureLayer.addAttachment I get the error message "AttributeError: 'set' object has no attribute 'items' with a reference to following calls:
File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\agol\services.py", line 1422, in addAttachment proxy_url=self._proxy_url) File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\web_base.py", line 466, in _post files=files) File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\web_base.py", line 96, in init for key,v in files.items():
Anyone a clue