Skip to content

Commit 2e9aa50

Browse files
committed
modifed some example scripts; added defrevs.py to examples dir; dropped typedefs.py from examples dir; regenerated html docs
1 parent ceedaec commit 2e9aa50

File tree

10 files changed

+52
-16
lines changed

10 files changed

+52
-16
lines changed
0 Bytes
Binary file not shown.
-30 Bytes
Binary file not shown.

doc/build/html/_sources/interface.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ The priority chain consists of these steps:
142142
- RALLY_SERVER
143143
- RALLY_USER
144144
- RALLY_PASSWORD
145-
- RALLY_APIKEY
145+
- APIKEY
146146
- RALLY_WORKSPACE
147147
- RALLY_PROJECT
148148
* if present, use information from a rally-<version>.cfg file in the current directory,

doc/build/html/interface.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ <h1>rallyWorkset<a class="headerlink" href="#rallyworkset" title="Permalink to t
201201
<li>RALLY_SERVER</li>
202202
<li>RALLY_USER</li>
203203
<li>RALLY_PASSWORD</li>
204-
<li>RALLY_APIKEY</li>
204+
<li>APIKEY</li>
205205
<li>RALLY_WORKSPACE</li>
206206
<li>RALLY_PROJECT</li>
207207
</ul>

doc/build/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/defrevs.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python
2+
3+
#################################################################################################
4+
#
5+
# defrevs -- show the revisions for a specific defect
6+
#
7+
USAGE = """
8+
python defrevs [CONFIG] <Defect_FormattedID>
9+
10+
where CONFIG is either command line arguments or the
11+
specification of a file containing pyral related config info
12+
"""
13+
#################################################################################################
14+
15+
import sys, os
16+
from pyral import Rally, rallyWorkset
17+
18+
#################################################################################################
19+
20+
def main(args):
21+
options = [opt for opt in args if opt.startswith('--')]
22+
args = [arg for arg in args if arg not in options]
23+
server, user, password, apikey, workspace, project = rallyWorkset(options)
24+
rally = Rally(server, user, password, apikey=apikey, workspace=workspace, project=project)
25+
26+
target = args.pop(0)
27+
fields = "FormattedID,State,Name,CreationDate,RevisionHistory,Revisions"
28+
criteria = "FormattedID = %s" % target
29+
30+
defect = rally.get('Defect', fetch=fields, query=criteria, instance=True)
31+
32+
print "%s %10.10s %-11s %s" % (defect.FormattedID, defect.CreationDate,
33+
defect.State, defect.Name)
34+
print ""
35+
for rev in reversed(defect.RevisionHistory.Revisions):
36+
print "%d) %-22.22s %-16.16s %s\n" % \
37+
(rev.RevisionNumber, rev.CreationDate.replace('T', ' '),
38+
rev.User.DisplayName, rev.Description)
39+
40+
#################################################################################################
41+
#################################################################################################
42+
43+
if __name__ == '__main__':
44+
main(sys.argv[1:])
45+
sys.exit(0)

examples/getitem.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,7 @@ def main(args):
8282
sys.exit(5)
8383

8484
for item in response:
85-
for attr in COMMON_ATTRIBUTES:
86-
print " %-16.16s : %s" % (attr, getattr(item, attr))
87-
attrs = [attr for attr in item.attributes() if attr not in COMMON_ATTRIBUTES]
88-
for attr in sorted(attrs):
89-
attribute = getattr(item, attr)
90-
cn = attribute.__class__.__name__
91-
if cn[0] in string.uppercase:
92-
attribute = attribute.Name if cn != 'NoneType' else None
93-
print " %-16.16s : %s" % (attr, attribute)
85+
print item.details()
9486

9587
#################################################################################################
9688
#################################################################################################

examples/periscope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def main(args):
2525
for workspace in rally.getWorkspaces():
2626
print "%s %s" % (workspace.oid, workspace.Name)
2727
for project in rally.getProjects(workspace=workspace.Name):
28-
print " %12.12s %s" % (project.oid, project.Name)
28+
print " %12.12s %-36.36s |%s|" % (project.oid, project.Name, project.State)
2929
print ""
3030

3131
#################################################################################################

examples/repoitems.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ def showRepoItems(rally, repo_name, workspace=None, limit=200, order="ASC", sinc
7979
criteria = by_repo
8080
if since_date:
8181
date_cond = "CommitTimestamp >= %s" % since_date
82-
criteria = "((%s) and (%s))" % (by_repo, date_cond)
83-
82+
criteria = [by_repo, date_cond]
8483

8584
try:
8685
response = rally.get('Changeset', fetch=True,

examples/showdefects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def main(args):
2525
rally = Rally(server, user=username, password=password, workspace=workspace, project=project)
2626
rally.enableLogging("rally.history.showdefects")
2727

28-
fields = "FormattedID,State,Name,Severity,Priority",
28+
fields = "FormattedID,State,Name,Severity,Priority"
2929
criterion = 'State != Closed'
3030

3131
response = rally.get('Defect', fetch=fields, query=criterion, order="FormattedID",

0 commit comments

Comments
 (0)