gam.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:GAMADV-XTD 作者: taers232c 项目源码 文件源码
def getPrinterScopeListsForRole(cp, printerId, i, count, role):
  try:
    result = callGCP(cp.printers(), u'get',
                     throw_messages=[GCP.UNKNOWN_PRINTER],
                     printerid=printerId)
    try:
      jcount = len(result[u'printers'][0][u'access'])
    except KeyError:
      jcount = 0
    scopeList = []
    if jcount > 0:
      for acl in result[u'printers'][0][u'access']:
        if acl.get(u'role') == role:
          scopeList.append(acl[u'scope'].lower())
    return scopeList
  except GCP.unknownPrinter as e:
    entityActionFailedWarning([Ent.PRINTER, printerId], str(e), i, count)
    return None

# gam printer|printers <PrinterIDEntity> sync user|manager|owner <PrinterACLScopeEntity> [notify]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号