Posting new targets to vuforia with Python - python

I'm trying to make a cms with Python to post new targets to a cloud database on vuforia. I found this Python library "python-vuforia" but it has read functionalities only.
I added a function to post targets but so far getting 401 error. you can find the new function in this commit
What am I doing wrong?

Got it working with this (commit)[https://github.com/dadoeyad/python-vuforia/commit/1997a49f94c5f2e13ab1d5c620c69160c76b7969]
I think the problem was with doing str(req.get_data()) instead of req.get_data()
and base64.b64encode(hmac(key, message, sha1).digest()) instead of hmac(key, message, sha1).digest().encode('base64')

Related

Recieving Null response from visitorsession variable during deployment salesIq zo

I am a little baffled with the issue I am facing with Zobot. I have developed a Zobot in which I am using visitorsession to store some values and reuse them later. It works great in Zoho Developer environment, we used Deluge scripts option to do the development.
But when I deploy it using embed script on my website, the visitorsession part of the code is returning null. I searched around and found not a single person facing this issue or posting it, I am really surprised its happening only to me. Can someone please suggest what I should do. I have explained what I am facing below:
I am storing values like this
storeResponse2 = zoho.salesiq.visitorsession.set(portal_name,{"a":"b"});
I am getting the values like this
zoho.salesiq.visitorsession.get(portal_name,"a").get("data").get("a");
It is working great in Zobot Development environment in the Preview section, but when I go to my website where I put the embed, I am getting null.
In both environments, the response I get when I do the set is the same. Its not throwing any error, it is giving me valid response. The response I am getting when I set, in both environments is:
{"url":"/api/v2/bigtalk/visitorsessions","object":"session","data":{"a":"b"}}
But when I do a get, in Zoho environment I get correct value, in production I get null
Attachments area
If this happens, it probably means that you are setting and getting the data from visitorsession in the same execution.
It doesn't work that way. It should be set in one execution and get in further executions (replies). And this won't be a problem anyway, as in the same execution, you'll have the data available already.

Reading/writing error messages from data factory pipelines

Going to try asking this here.
I'm trying to write an error message from an Azure Data Factory pipeline to a table in SQL server. It needs to capture the error message from a Databricks Python job. I can't find any official documentation and the method I have found from this source:
#{activity('Proc source').error.message}
..doesn't write anything to the table. Just a blank string with no explanation.
Why data factory doesn't just have an area where you can view the details of errors instead of just saying "Failed" is beyond me. Or if it does, it's hidden away.
Does anyone have any ideas?
You can see the details of error at here.
#{activity('Proc source').error.message}
This expression works.
Is errorCode saved to your table?Make sure your activity name is correct.
SOLVED:
For anyone else reading this, the problem turned out to be something very stupid. I'd included a space in the python file name.
This returned an error code of 3202 and a blank error message.
I had another problem and resolution after this that I'd like to share, again for anyone frantically googling a solution to the problem. Once I'd removed spaces from the python filename, I logged an error code of '3204'
and the error message: "Databricks execution failed with error message: . Run page url: (link to page showing clusters)". In the Databricks workspace launchable through the Azure portal, selecting a cluster through the 'clusters' sidebar then heading to 'Driver Logs' will show errors, in the 'Standard error' window that comes up.
I had already installed the libraries I needed on an existing cluster, but I'd forgotten to change a setting in the Databricks linked service. 'Select cluster' was set to 'new job cluster' when I needed 'Existing interactive cluster'. Thus, it wasn't pointing to the cluster I had expected.
These are all fairly small errors as it turns out, but again I hope that someone else dealing with the same issues will be able to find this post and save themselves some hassle!

Problems flagging/unflagging JIRA issues using jira-python

I use the Python JIRA API wrapper almost daily to log time, add comments, and transition issues. Recently my team decided to replace the "Roadblock" status with an "Impediment" flag. My issue is that I cannot flag/unflag an issue from within an issue (https://jira.atlassian.com/browse/JSWSERVER-16346).
The following code to update customfield_10500 (the flag) does not work:
jira = JIRA(options=options, basic_auth=(os.getenv('user'), os.getenv('pass')))
i = jira.issue('BIS-9')
i.update(fields={
'customfield_10500' : {'value' : 'Impediment'}
})
The error
JIRAError: JiraError HTTP 400 url
response text = {"errorMessages":[],"errors":{"customfield_10500":"Field 'customfield_10500' cannot be set. It is not on the appropriate screen, or unknown."}}
I know the field must be set within the Kanban board, but I don't know how to do this using the Python wrapper.
Is there a way to do this?
I've found this but don't know how to translate it.
If you want to update a customfield through RestApi the customfield should be added into the Edit Mode Screen.
I believe this is why it is showing the above error

How to access array values in Postman using python

I came across this question that was asked a while back to send array data in postman (Is it possible to send an array with the Postman Chrome extension?).
My problem is though, I want to be able to access all those variables sent. Currently, I'm only receiving the first one because I say:
key=shareholder, value=100
If I try
key=shareholder[0], value=100
key=shareholder[1], value=200
or even without the indexes,then I get a NONETYPE error for shareholder
code:
request_data={
"shareholder": []
}
request_data["shareholder"].append(int(request.form.get("shareholder")))
Would definitely appreciate the help. Sorry if anything I said is unclear
To access a variable in Postman is incredibly easy. BUT, Postman is Javascript application. You need to use python nowhere with postman. Javascript is a comprehensive one.
I didn't get what kind of variable you want to access, but if you give me a clear example I will tell you how to reach any level of variable in postman
MORE INFO:
https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables

XML Parsing Error: not well-formed Location: moz-nullprincipal

I am having a problem posting map data to postgis via apache2 --> geoserver-->OpenLayers 12.04.
I am receiving data from geoserver just fine but unable to post new data back.
The post error is:
XML Parsing Error: not well-formed Location: moz-nullprincipal:
#!/usr/bin/env python
-^
What I get for a response is the text of the proxy.cgi script provided by OpenLayers. I have edited this script to include all sources found in the xml formed by the request to make sure that I have included all urls.
I have Python, Python2 and Python2.7 available but using any of these produces the same result. All includes appear to be loading correctly.
I have read numerous posts related to this issue but none have provided a solution. I used to be able to bypass the same domain issue by creating an index.html outside the apache-tomcat directory that would define an iframe that would call my actual site.html residing in /geoserver/www. This no longer appears to work hence my proxy problem. This project is on hold until this issue is solved.
Any help would be greatly appreciated.
Thanks, Larry
I found another way to do it. Rather than using the OpenLayers proxy I found this blog:
http://bikerjared.wordpress.com/2012/10/18/ubuntu-12-04-mod-proxy-install-and-configuration/
that provides a very good tutorial on using an Apache2 proxy that fixed my problem nicely.

Categories

Resources