本文整理汇总了Python中omero_sys_ParametersI.ParametersI.page方法的典型用法代码示例。如果您正苦于以下问题:Python ParametersI.page方法的具体用法?Python ParametersI.page怎么用?Python ParametersI.page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类omero_sys_ParametersI.ParametersI
的用法示例。
在下文中一共展示了ParametersI.page方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testFilter
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import page [as 别名]
def testFilter(self):
p = ParametersI()
p.noPage()
assert None == p.theFilter
p.page(2, 3)
assert p.isPagination()
assert rint(2) == p.theFilter.offset
assert rint(3) == p.theFilter.limit
p.noPage()
assert not p.isPagination()
assert None == p.theFilter.offset
assert None == p.theFilter.limit
assert None == p.getLimit()
assert None == p.getOffset()
示例2: testFilter
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import page [as 别名]
def testFilter(self):
p = ParametersI()
p.noPage()
self.assertEquals(None, p.theFilter)
p.page(2,3)
self.assert_(p.isPagination())
self.assertEquals( rint(2), p.theFilter.offset )
self.assertEquals( rint(3), p.theFilter.limit )
p.noPage()
self.assertFalse(p.isPagination())
self.assertEquals(None, p.theFilter.offset)
self.assertEquals(None, p.theFilter.limit)
self.assertEquals(None, p.getLimit())
self.assertEquals(None, p.getOffset())
示例3: hql
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import page [as 别名]
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