當前位置: 首頁>>代碼示例>>Python>>正文


Python ZenModelRM.checkValidId方法代碼示例

本文整理匯總了Python中ZenModelRM.ZenModelRM.checkValidId方法的典型用法代碼示例。如果您正苦於以下問題:Python ZenModelRM.checkValidId方法的具體用法?Python ZenModelRM.checkValidId怎麽用?Python ZenModelRM.checkValidId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ZenModelRM.ZenModelRM的用法示例。


在下文中一共展示了ZenModelRM.checkValidId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: checkValidId

# 需要導入模塊: from ZenModelRM import ZenModelRM [as 別名]
# 或者: from ZenModelRM.ZenModelRM import checkValidId [as 別名]
 def checkValidId(self, id, prep_id = False):
     """Checks a valid id
     """
     if len(id) > 128:
         return 'Command definition names can not be longer than 128 characters.'
     allowed = set(string.ascii_letters + string.digits + '_')
     attempted = set(id)
     if not attempted.issubset(allowed):
         return 'Only letters, digits and underscores are allowed' + \
                 ' in command definition names.'
     return ZenModelRM.checkValidId(self, id, prep_id)
開發者ID:bbc,項目名稱:zenoss-prodbin,代碼行數:13,代碼來源:DataRoot.py

示例2: checkValidId

# 需要導入模塊: from ZenModelRM import ZenModelRM [as 別名]
# 或者: from ZenModelRM.ZenModelRM import checkValidId [as 別名]
 def checkValidId(self, id, prep_id = False):
     """Checks a valid id
     """
     # RRD docs say that limit on vnames is 255 characters and that
     # A-Za-z0-9_ are the valid characters.  Zenoss reserves - for it's own
     # use.  Limiting to 200 instead just to leave room for whatever.
     # http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html
     if len(id) > 200:
         return 'GraphPoint names can not be longer than 200 characters.'
     allowed = set(string.ascii_letters + string.digits + '_')
     attempted = set(id)
     if not attempted.issubset(allowed):
         return 'Only letters, digits and underscores are allowed' + \
                 ' in GraphPoint names.'
     return ZenModelRM.checkValidId(self, id, prep_id)
開發者ID:SteelHouseLabs,項目名稱:zenoss-prodbin,代碼行數:17,代碼來源:GraphDefinition.py


注:本文中的ZenModelRM.ZenModelRM.checkValidId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。