-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.py
More file actions
59 lines (43 loc) · 1.35 KB
/
Copy pathquery.py
File metadata and controls
59 lines (43 loc) · 1.35 KB
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
###########################################################
#
# Copyright (c) 2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#
'''query.py: simple script to query for set information
'''
# import the client api library
from tactic_client_lib import TacticServerStub
def main():
# get an instance of the stub
server = TacticServerStub()
# start the transaction
server.start("Set query")
try:
# define the search type we are searching for
search_type = "prod/asset"
# define a filter
filters = []
filters.append( ("asset_library", "chr") )
# do the query
assets = server.query(search_type, filters)
# show number found
print("found [%s] assets" % len(assets) )
# go through the asset and print the code
for asset in assets:
code = asset.get("code")
print(code)
except:
# in the case of an exception, abort all of the interactions
server.abort()
raise
else:
# otherwise, finish the transaction
server.finish()
if __name__ == '__main__':
main()