Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kakwa/gforge-soap-client
small python soap client library for gforge advanced
https://github.com/kakwa/gforge-soap-client
api client gforge soap
Last synced: about 1 month ago
JSON representation
small python soap client library for gforge advanced
- Host: GitHub
- URL: https://github.com/kakwa/gforge-soap-client
- Owner: kakwa
- License: mit
- Created: 2016-06-28T21:17:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-28T21:19:50.000Z (over 8 years ago)
- Last Synced: 2024-04-16T18:34:01.397Z (9 months ago)
- Topics: api, client, gforge, soap
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
# gforge_stuff
A small library to recover trackers from gforge using its Soap API.
# Dependencies
* python-suds (soap client library)
* python-mako (template engin)# Usage
## Command line
The url to the WSDL looks something like **http[s]://\[/gf]/xmlcompatibility/soap5/\?wsdl**
Simple printing:
```bash
# printing the trackers to stdout
$ gforge-cli -l -p -u -P
```Printing with a mako template:
```bash
# building a document from a mako template# to stdout
$ gforge-template -l -p -u \
-P -t -s# to a file
$ gforge-template -l -p -u \
-P -t -o
```A template example is available in **goodies/changelog.py**.
## Library
```python
import gforge_soap_client# for utf-8 to stdout
import sys
reload(sys)
sys.setdefaultencoding('utf-8')login=""
password=""
url=""
project="" # (unix name)# initialize
gTracker = gforge_soap_client.SoapClient(url, login, password, project)
# import the trackers
gTracker.import_trackers()# print to stdout
#gTracker.print_trackers()# printing the raw tracker information, without id resolution and html unescape
print(gTracker.trackers_raw)# printing the list of trackers
print(gTracker.trackers_name)# "pretty" printing of trackers (with extra fields id and users id resolution and html unescape)
print(gTracker.trackers)# ordering trackers information
from distutils.version import LooseVersionfor t_name in gTracker.trackers_name:
print('Tracker: ' + t_name + '\n')item_by_release = gTracker.organize_items_by_field(gTracker.trackers[t_name]['items'], field='Fixed In Release')
for release in sorted(item_by_release, key=LooseVersion, reverse=True):
print('Release: ' + release + '\n')
item_by_type = gTracker.organize_items_by_field(item_by_release[release], field='Type')
for itype in sorted(item_by_type):
for item in item_by_type[itype]:
print(item['Type'] + ', ' + item['tracker_item_id'] + ', ' + item['summary'])
print("")
```