本文整理汇总了Python中FPNative类的典型用法代码示例。如果您正苦于以下问题:Python FPNative类的具体用法?Python FPNative怎么用?Python FPNative使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FPNative类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: close
def close( self ):
if( self.top_handle != 0 ):
FPNative.tag_close( self.top_handle )
self.check_error()
if( self.handle != 0 ):
FPNative.clip_close( self.handle )
self.check_error()
示例2: _close
def _close(self):
"""Close a clip. If it's not open, just don't check for errors.
"""
if self.top_handle != 0:
log.debug("Closing top_tag handle.")
FPNative.tag_close(self.top_handle)
self.check_error()
self.top_handle = 0
if self.handle != 0:
log.debug("Closing handle.")
FPNative.clip_close(self.handle)
self.check_error()
self.handle = 0
示例3: close
def close(self, force=False):
"""
Deallocate pool resources.
:param force: issue pool_close without checking if the pool is closed.
:return:
"""
if self._opened or force:
log.debug("Closing pool with handle: %r", self.handle)
FPNative.pool_close(self.handle)
self.check_error()
self._opened = False
log.debug("Pool correctly closed: %r", self.handle)
else:
log.warning("Trying to close an already closed pool at handle %r.", self.handle)
示例4: getDescriptionAttributeIndex
def getDescriptionAttributeIndex( self, index ):
value = FPNative.clip_get_description_attribute_index( self.handle, \
index)
self.check_error()
return value
示例5: getPreviousRetentionClass
def getPreviousRetentionClass(self):
retention_class = FPNative.retention_class_context_get_previous_class(
self.context)
self.check_error()
return retention_class
示例6: getNextRetentionClass
def getNextRetentionClass(self):
retention_class = FPNative.retention_class_context_get_next_class(
self.context)
self.check_error()
return retention_class
示例7: getNamedRetentionClass
def getNamedRetentionClass(self, name):
retention_class = FPNative.retention_class_context_get_named_class(
self.context, name)
self.check_error()
return retention_class
示例8: getTopTag
def getTopTag( self ):
if( self.top_handle == 0 ):
self.top_handle = FPNative.get_top_tag( self.handle )
self.check_error()
return self.top_handle
示例9: check_error
def check_error(self):
err = FPNative.get_last_error()
if err != 0:
errInfo = FPNative.get_last_error_info()
if errInfo[5] == self.FP_NETWORK_ERROR:
raise FPNetException(errInfo)
elif errInfo[5] == self.FP_SERVER_ERROR:
raise FPServerException(errInfo)
elif errInfo[5] == self.FP_CLIENT_ERROR:
raise FPClientException(errInfo)
else:
raise FPException(errInfo)
示例10: __init__
def __init__(self, pool, name=None, close_retries=0):
# Validate inserted data.
if pool is None:
raise FPException("No Pool Reference")
if name is not None:
self.handle = FPNative.clip_create(pool.handle, name)
self.check_error()
self.pool_handle = pool.handle
self.close_retries = close_retries
def __getattr__(self, item):
# Fallback on proxied methods.
if item in _proxied_methods:
def f(self, *args, **kwargs):
m = getattr(FPNative, 'clip_' + item)
ret = m(*args, **kwargs)
self.check_error()
f.__doc__ = m.__doc__
f.__name__ = m.__name__
return ret
return f
示例11: isRetentionClassValid
def isRetentionClassValid( self, retention_class ):
value = FPNative.clip_validate_retention_class( self.handle, \
retention_class )
self.check_error()
return value
示例12: getDescriptionAttribute
def getDescriptionAttribute( self, attribute ):
value = FPNative.clip_get_description_attribute( self.handle, \
attribute )
self.check_error()
return value
示例13: openRetentionClassContext
def openRetentionClassContext(self):
value = FPNative.get_retention_class_context(self.handle)
self.check_error()
self.context = value
return value
示例14: open
def open(self, clipid, mode=FPLibrary.FP_OPEN_ASTREE):
"""
:param clipid:
:param mode: FPLibrary.FP_OPEN_ASTREE (default) or FPLibrary.FP_OPEN_FLAT
:return:
"""
self.clipid = clipid
self.handle = FPNative.clip_open(self.pool_handle, clipid, mode)
self.check_error()
示例15: __init__
def __init__(self, tag, name=None):
if(name is None):
self.handle = tag
if(name is not None):
self.top_handle = tag
self.handle = FPNative.tag_create(self.top_handle, name)
self.check_error()