pivotaltracker

How do I post non-ASCII characters using httplib when content-type is “application/xml”

心已入冬 提交于 2019-12-19 17:47:57
问题 I've implemented a Pivotal Tracker API module in Python 2.7. The Pivotal Tracker API expects POST data to be an XML document and "application/xml" to be the content type. My code uses urlib/httplib to post the document as shown: request = urllib2.Request(self.url, xml_request.toxml('utf-8') if xml_request else None, self.headers) obj = parse_xml(self.opener.open(request)) This yields an exception when the XML text contains non-ASCII characters: File "/usr/lib/python2.7/httplib.py", line 951,

How do I post non-ASCII characters using httplib when content-type is “application/xml”

折月煮酒 提交于 2019-12-19 17:47:12
问题 I've implemented a Pivotal Tracker API module in Python 2.7. The Pivotal Tracker API expects POST data to be an XML document and "application/xml" to be the content type. My code uses urlib/httplib to post the document as shown: request = urllib2.Request(self.url, xml_request.toxml('utf-8') if xml_request else None, self.headers) obj = parse_xml(self.opener.open(request)) This yields an exception when the XML text contains non-ASCII characters: File "/usr/lib/python2.7/httplib.py", line 951,

Convert XML collection (of Pivotal Tracker stories) to Ruby hash/object

杀马特。学长 韩版系。学妹 提交于 2019-12-04 09:47:45
问题 I have a collection of stories in an XML format. I would like to parse the file and return each story as either hash or Ruby object, so that I can further manipulate the data within a Ruby script. Does Nokogiri support this, or is there a better tool/library to use? The XML document has the following structure, returned via Pivotal Tracker's web API: <?xml version="1.0" encoding="UTF-8"?> <stories type="array" count="145" total="145"> <story> <id type="integer">16376</id> <story_type>feature<

How can I automate Pivotal Tracker & Github Integration?

浪子不回头ぞ 提交于 2019-12-03 06:38:55
问题 Pivotal Tracker and Github have great integration: Once it's set up, each commit which is prefixed by the Pivotal Tracker ID will appear under the corresponding Pivotal Ticket automatically, for an example: git commit -am '[#1234567] my new changes' git push origin will add the comment 'my new changes' automatically to the 1234567 Pivotal Ticket among with the github commit link. However, it's easy to forget to add the ticket ID each time. How could it be simplified / automated? 回答1: The

Convert XML collection (of Pivotal Tracker stories) to Ruby hash/object

懵懂的女人 提交于 2019-12-03 04:02:20
I have a collection of stories in an XML format. I would like to parse the file and return each story as either hash or Ruby object, so that I can further manipulate the data within a Ruby script. Does Nokogiri support this, or is there a better tool/library to use? The XML document has the following structure, returned via Pivotal Tracker's web API : <?xml version="1.0" encoding="UTF-8"?> <stories type="array" count="145" total="145"> <story> <id type="integer">16376</id> <story_type>feature</story_type> <url>http://www.pivotaltracker.com/story/show/16376</url> <estimate type="integer">2<

How can I automate Pivotal Tracker & Github Integration?

我与影子孤独终老i 提交于 2019-12-02 19:13:48
Pivotal Tracker and Github have great integration: Once it's set up, each commit which is prefixed by the Pivotal Tracker ID will appear under the corresponding Pivotal Ticket automatically, for an example: git commit -am '[#1234567] my new changes' git push origin will add the comment 'my new changes' automatically to the 1234567 Pivotal Ticket among with the github commit link. However, it's easy to forget to add the ticket ID each time. How could it be simplified / automated? The solution is to use Git-Hooks and feature branches. (The Github-flow is recommended). You have to install this

How to use Requests Python module to make curl calls

不想你离开。 提交于 2019-12-01 01:50:21
I need to use an API that makes cURL calls. API shown here: https://www.pivotaltracker.com/help/api/rest/v5 . I am coding in Python 2.7 and downloaded the Requests module to use for the cURL calls, however I'm not exactly sure how to do this. This is what I have so far: import requests username = 'my_username' password = 'my_password' url = 'https://www.pivotaltracker.com/n/projects/my_project_number' r = requests.get(url, auth=(username, password)) Now that I have the response r, what do I do with it to make the cURL calls in order to use the API functions, such as the GET /projects/{project

How to use Requests Python module to make curl calls

折月煮酒 提交于 2019-11-30 21:04:00
问题 I need to use an API that makes cURL calls. API shown here: https://www.pivotaltracker.com/help/api/rest/v5. I am coding in Python 2.7 and downloaded the Requests module to use for the cURL calls, however I'm not exactly sure how to do this. This is what I have so far: import requests username = 'my_username' password = 'my_password' url = 'https://www.pivotaltracker.com/n/projects/my_project_number' r = requests.get(url, auth=(username, password)) Now that I have the response r, what do I do