本文整理汇总了Python中omero_sys_ParametersI.ParametersI类的典型用法代码示例。如果您正苦于以下问题:Python ParametersI类的具体用法?Python ParametersI怎么用?Python ParametersI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParametersI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGroupId
def testGroupId(self):
p = ParametersI()
self.assertNull(p.theFilter)
p.grp(rlong(1))
self.assertNotNull(p.theFilter)
self.assertNotNull(p.theFilter.groupId)
assert rlong(1) == p.getGroup()
self.assertNull(p.allGrps().getGroup())
self.assertNotNull(p.theFilter)
示例2: testOwnerId
def testOwnerId(self):
p = ParametersI()
self.assertNull(p.theFilter)
p.exp(rlong(1))
self.assertNotNull(p.theFilter)
self.assertNotNull(p.theFilter.ownerId)
assert rlong(1) == p.getExperimenter()
self.assertNull(p.allExps().getExperimenter())
self.assertNotNull(p.theFilter)
示例3: testGroup
def testGroup(self):
p = ParametersI()
p.grp(rlong(1))
self.assert_(p.isGroup())
self.assertEquals(p.getGroup().getValue(), 1L)
p.allGrps()
self.assertFalse(p.isGroup())
示例4: testExperimenter
def testExperimenter(self):
p = ParametersI()
p.exp(rlong(1))
assert p.isExperimenter()
assert p.getExperimenter().getValue() == 1L
p.allExps()
assert not p.isExperimenter()
示例5: testExperimenter
def testExperimenter(self):
p = ParametersI()
p.exp(rlong(1))
self.assertTrue(p.isExperimenter())
self.assertEquals(p.getExperimenter().getValue(), 1L)
p.allExps()
self.assertFalse(p.isExperimenter())
示例6: testGroup
def testGroup(self):
p = ParametersI()
p.grp(rlong(1))
assert p.isGroup()
assert p.getGroup().getValue() == 1L
p.allGrps()
assert not p.isGroup()
示例7: testDefaults
def testDefaults(self):
p = ParametersI()
# Removed: assert not p.isLeaves()
assert not p.isGroup()
assert not p.isExperimenter()
assert not p.isEndTime()
assert not p.isStartTime()
assert not p.isPagination()
assert not p.getUnique()
示例8: testTimes
def testTimes(self):
p = ParametersI()
self.assertNull(p.theFilter)
p.startTime(rtime(0))
self.assertNotNull(p.theFilter)
self.assertNotNull(p.theFilter.startTime)
p.endTime(rtime(1))
self.assertNotNull(p.theFilter.endTime)
p.allTimes()
self.assertNotNull(p.theFilter)
self.assertNull(p.theFilter.startTime)
self.assertNull(p.theFilter.endTime)
示例9: testBasics
def testBasics(self):
p = ParametersI()
p.exp(rlong(1))
p.grp(rlong(1))
p.endTime(rtime(1))
示例10: testAddLongs
def testAddLongs(self):
p = ParametersI()
p.addLongs("longs", [1, 2])
p.map["longs"].val.index(rlong(1))
p.map["longs"].val.index(rlong(2))
示例11: testAddIds
def testAddIds(self):
p = ParametersI()
p.addIds([1, 2])
p.map["ids"].val.index(rlong(1))
p.map["ids"].val.index(rlong(2))
示例12: testAddLongRType
def testAddLongRType(self):
p = ParametersI()
p.addLong("long", rlong(1))
assert rlong(1) == p.map["long"]
示例13: hql
def hql(self, args, loop = False):
from omero_sys_ParametersI import ParametersI
ice_map = dict()
if args.admin:
ice_map["omero.group"]="-1"
c = self.ctx.conn(args)
q = c.sf.getQueryService()
p = ParametersI()
p.page(args.offset, args.limit)
rv = self.project(q, args.query, p, ice_map)
has_details = self.display(rv)
if args.quiet:
return
input = """
To see details for object, enter line number.
To move ahead one page, enter 'p'
To re-display list, enter 'r'.
To quit, enter 'q' or just enter.
"""
if loop:
input = input + """To run another query, press enter\n"""
while True:
id = self.ctx.input(input)
id = id.lower()
# Exit loop
if not id:
return True
if id.startswith("q"):
return False
# Stay in loop
if id.startswith("p"):
p.page(p.getOffset().val + p.getLimit().val, p.getLimit())
self.ctx.dbg("\nCurrent page: offset=%s, limit=%s\n" % (p.theFilter.offset.val, p.theFilter.limit.val))
rv = self.project(q, args.query, p, ice_map)
self.display(rv)
elif id.startswith("r"):
self.display(rv)
else:
try:
id = long(id)
obj = rv[id]
if id not in has_details:
self.ctx.out("No details available: %s" % id)
continue
else:
obj = obj[0].val # Unwrap the object_list from IQuery.projection
except:
self.ctx.out("Invalid choice: %s" % id)
continue
keys = sorted(obj.__dict__)
keys.remove("_id")
keys.remove("_details")
self.ctx.out("id = %s" % obj.id.val)
for key in keys:
value = self.unwrap(obj.__dict__[key])
if isinstance(value, (str, unicode)):
value = "'%s'" % value
if key.startswith("_"):
key = key[1:]
self.ctx.out("%s = %s" % (key, value))
continue
示例14: rint
filter.limit = rint(10)
filter.offset = rint(0)
plates = q.findAll("Plate", filter)
if len(plates) == 0:
print "No plates"
sys.exit(0)
else:
import random
example_plate = random.choice(plates)
print "Loading wells for Plate %s (%s)" % (example_plate.getId().getValue(), example_plate.getName().getValue())
# An example of true paging
filter.limit = rint(12)
params = ParametersI()
params.addId(example_plate.getId().getValue())
params.theFilter = filter
offset = 0
while True:
wells = q.findAllByQuery(LOAD_WELLS, params)
if len(wells) == 0:
break
else:
offset += len(wells)
params.theFilter.offset = rint( offset )
for well in wells:
id = well.getId().getValue()
示例15: testUnique
def testUnique(self):
p = ParametersI()
self.assertNull(p.getUnique())
assert rbool(True) == p.unique().getUnique()
assert rbool(False) == p.noUnique().getUnique()
self.assertNotNull(p.getUnique())