FogBugz » FogBugzPy A Python wrapper for the FogBugz API Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

Merge with py3

Changeset 12398498e210

Parents 06e9d4d46bce

Parents 79d9f08a8c91

by Jason R. Coombs

Changes to 6 files · Browse files at 12398498e210 Showing diff from parent 06e9d4d46bce 79d9f08a8c91 Diff from another changeset...

Change 1 of 1 Show Entire File .hgtags Stacked
 
10
11
12
 
 
 
 
10
11
12
13
14
15
@@ -10,3 +10,6 @@
 ce9989f282e77f6d0c84de50eb80a0534b62395a 0.9.5-20140603  b937588cfa55c91b9e5c5d17c59075593a0b70d0 0.9.5.post20140603  5d31b8683181abc0dfc77ab7224020d7bcc4bb5a 0.9.6.post20150610 +579541f6fede18cc5599dde1828478225d993407 1.0 +b4bc6d71d08df08bbf9b782ba8ea7e3efc28c8cd 1.0.1 +3afc6ae8c7a37f309529655efa448985e331b054 1.0.2
Change 1 of 1 Show Entire File LICENSE Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@@ -1,0 +1,22 @@
+Copyright (c) 2011, Fog Creek Software, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. Redistributions in binary form must +reproduce the above copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Change 1 of 1 Show Entire File MANIFEST Stacked
 
1
2
3
4
 
 
 
 
 
@@ -1,4 +1,0 @@
-# file GENERATED by distutils, do NOT edit -README.txt -fogbugz.py -setup.py
Change 1 of 1 Show Entire File README.txt Stacked
 
36
37
38
39
 
 
 
 
 
 
 
36
37
38
 
 
39
40
41
42
43
@@ -36,4 +36,8 @@
 For more info on the API:  http://our.fogbugz.com/help/topics/advanced/API.html   -Much of the API has not been thoroughly tested. Please report bugs to customer-service@fogcreek.com \ No newline at end of file
+Much of the API has not been thoroughly tested. Please report bugs to customer-service@fogcreek.com + +``fogbugz_bis`` is a fork of the FogCreek codebase to support Python 3 and +BeautifulSoup 4. You should install/require only one of ``fogbugz`` or +``fogbugz_bis`` as they both implement the same module.
Change 1 of 1 Show Entire File setup.cfg Stacked
 
1
2
 
 
 
 
 
1
2
@@ -1,2 +1,2 @@
-[egg_info] -tag_build=.post20150610 +[aliases] +release = sdist upload
Change 1 of 1 Show Entire File setup.py Stacked
 
1
2
3
4
 
5
6
 
7
8
9
10
11
12
13
14
15
16
 
 
17
18
19
20
21
22
 
 
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
 
 
 
 
 
 
 
1
2
 
3
4
 
 
 
 
 
 
5
 
 
6
7
8
 
 
 
 
 
9
10
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55
@@ -1,123 +1,55 @@
-try: - from setuptools import setup -except ImportError: - from distutils.core import setup +import io   -from textwrap import dedent +import setuptools   -setup(name='fogbugz', - version='0.9.6', - py_modules=['fogbugz'], - license=dedent("""\ - Copyright (c) 2011, Fog Creek Software, Inc. - All rights reserved.   - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: +with io.open('README.txt', encoding='utf-8') as readme: + long_description = readme.read()   - Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. Redistributions in binary form must - reproduce the above copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided with the - distribution. +with io.open('LICENSE', encoding='utf-8') as readme: + license = readme.read()   - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """), - description='Python library for interacting with the FogBugz API', - long_description=dedent("""\ - Python FogBugz API Wrapper - --------------------------   - This Python API is simply a wrapper around the FogBugz API, with some help from Leonard Richardson's BeautifulSoup (http://www.crummy.com/software/BeautifulSoup/) and the magic of Python's __getattr__(). +setup_params = dict( + name='fogbugz_bis', + use_scm_version=True, + py_modules=['fogbugz'], + license=license, + description='Python library for interacting with the FogBugz API', + long_description=long_description, + author='Fog Creek Software', + author_email='customer-service@fogcreek.com', + maintainer='YouGov, Plc.', + maintainer_email='open-source@yougov.com', + url='https://github.com/yougov/FogBugzPy', + install_requires=[ + 'BeautifulSoup4', + 'lxml', + 'six', + ], + requires='BeautifulSoup', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Natural Language :: English', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX', + 'Operating System :: POSIX :: BSD', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python', + 'Topic :: Internet :: WWW/HTTP', + 'Topic :: Software Development', + 'Topic :: Software Development :: Bug Tracking', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Software Development :: Version Control', + 'Topic :: Utilities', + ], + setup_requires=[ + 'setuptools_scm', + ], +)   - Getting Started: - ---------------- - To use the FogBugz API, install the package either by downloading the source and running - - $ python setup.py install - - or by using pip - - $ pip install fogbugz - - A Quick Example: - ---------------- - - :: - - >>> from fogbugz import FogBugz - >>> fb = FogBugz("http://example.fogbugz.com/") # URL is to your FogBugz install - >>> fb.logon("logon@example.com", "password") - >>> resp = fb.search(q="assignedto:tyler") # All calls take named parameters, per the API - >>> resp # Responses are BeautifulSoup objects of the response XML. - <response> - <cases count="2"> - <case ixbug="1" operations="edit,assign,resolve,email,remind"></case> - <case ixbug="2" operations="edit,spam,assign,resolve,reply,forward,remind"></case> - </cases> - </response> - >>> # You shouldn't need to know too much about BeautifulSoup, but the documentation can be found here: - >>> # http://www.crummy.com/software/BeautifulSoup/documentation.html - >>> for case in resp.cases.childGenerator(): # One way to access the cases - ... print case['ixbug'] - ... - 1 - 2 - >>> for case in resp.findAll('case'): # Another way to access the cases - ... print case['operations'] - ... - edit,assign,resolve,email,remind - edit,spam,assign,resolve,reply,forward,remind - >>> resp = fb.edit(ixbug=1, sEvent="Edit from the API") # Note the named parameters - >>> resp - <response><case ixbug="1" operations="edit,assign,resolve,email,remind"></case></response> - >>> # To upload files, just pass a `Files` parameter that is a dictionary of filename and file handle. New in 0.9.2. - >>> resp = fb.edit(ixbug=2, sEvent="Add a file from the API", Files={'filename': open('filename', 'r')}) # Note the named parameters - >>> resp - <response><case ixbug="2" operations="edit,assign,resolve,email,remind"></case></response> - - Note that, per API v5.0, all data between tags, such as the token, is now wrapped in CDATA. BeautifulSoup's implementation of CData generally allows for it to be treated as a string, except for one important case: CData.__str__() (a.k.a. str(CData)) returns the full text, including the CDATA wrapper (e.g. "<![CDATA[foo]]>"). To avoid accidentally including the CDATA tage, use CData.encode('utf-8') - - For more info on the API: - http://our.fogbugz.com/help/topics/advanced/API.html - """), - author='Fog Creek Software', - author_email='customer-service@fogcreek.com', - maintainer='Fog Creek Software', - maintainer_email='customer-service@fogcreek.com', - url='https://developers.kilnhg.com/Repo/FogBugz/Group/FogBugzPy', - download_url='https://developers.kilnhg.com/Repo/FogBugz/Group/FogBugzPy', - install_requires=[ - 'BeautifulSoup4', - 'lxml', - 'six', - ], - requires='BeautifulSoup', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Operating System :: POSIX :: BSD', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Software Development', - 'Topic :: Software Development :: Bug Tracking', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Software Development :: Version Control', - 'Topic :: Utilities', - ], -) +if __name__ == '__main__': + setuptools.setup(**setup_params)