@@ -9,14 +9,27 @@ def printProductType(productTypeDict):
9
9
print '\t %s = %s' % (key , value )
10
10
11
11
if __name__ == '__main__' :
12
-
13
- # connect to File Manager server
14
- # use verbose=True to print out every request/response
15
- verbose = False
16
- server = xmlrpclib .ServerProxy ('http://localhost:9000/' , verbose = verbose )
17
-
18
- print "Server is alive: %s" % server .filemgr .isAlive ()
19
-
20
- productTypes = server .filemgr .getProductTypes ()
21
- for productTypeDict in productTypes :
22
- printProductType (productTypeDict )
12
+
13
+ # connect to File Manager server
14
+ # use verbose=True to print out every request/response
15
+ verbose = False
16
+ server = xmlrpclib .ServerProxy ('http://localhost:9000/' , verbose = verbose )
17
+
18
+ # test server is alive
19
+ print "Server is alive: %s" % server .filemgr .isAlive ()
20
+
21
+ # query all product types
22
+ productTypes = server .filemgr .getProductTypes ()
23
+ for productTypeDict in productTypes :
24
+ printProductType (productTypeDict )
25
+
26
+ # retrieve a specific product type
27
+ # returned result is a dictionary suitable as argument for next call
28
+ productTypeName = "miRNAStudyPine"
29
+ productType = server .filemgr .getProductTypeByName (productTypeName )
30
+
31
+ # query all products of a given type
32
+ products = server .filemgr .getProductsByProductType ( productType )
33
+ print 'Printing products'
34
+ for product in products :
35
+ print product
0 commit comments