本文整理汇总了Python中pycb.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_md5
def get_md5(self):
pycb.log(logging.INFO, "===== def get_md5 of cbPosixBackend.py")
if self.hashValue == None:
v = str(self.md5er.hexdigest()).strip()
return v
pycb.log(logging.INFO, "=====## self.hashValue is %s"%self.hashValue)
return self.hashValue
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbPosixBackend.py
示例2: end_copy
def end_copy(self):
pycb.log(logging.INFO, "===== def end_copy of cbRequest.py")
try:
self.user.put_object(self.dst_file, self.dstBucketName, self.dstObjectName)
self.grant_public_permissions(self.dstBucketName, self.dstObjectName)
doc = Document()
cor = doc.createElement("CopyObjectResult")
doc.appendChild(cor)
lm = doc.createElement("LastModified")
cor.appendChild(lm)
lmText = doc.createTextNode(datetime(*self.src_ctm[:6]).isoformat())
lm.appendChild(lmText)
lm = doc.createElement("ETag")
cor.appendChild(lm)
lmText = doc.createTextNode(str(self.src_md5))
lm.appendChild(lmText)
x = doc.toxml();
self.setHeader(self.request, 'x-amz-copy-source-version-id', "1")
self.setHeader(self.request, 'x-amz-version-id', "1")
self.send_xml(x)
self.request.finish()
except cbException, (ex):
ex.sendErrorResponse(self.request, self.requestId)
traceback.print_exc(file=sys.stdout)
开发者ID:xxy-php,项目名称:code,代码行数:30,代码来源:cbRequest.py
示例3: new_connection
def new_connection(self, request):
pycb.log(logging.INFO, "===== def new_connection of cbRedirector.py")
h = None
self.connection_count = self.connection_count + 1
if self.connection_count > self.max:
h = self.get_next_host()
return h
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbRedirector.py
示例4: list_bucket
def list_bucket(self, bucketName, args):
pycb.log(logging.INFO, "===== def list_bucket of cbAuthzSecurity.py")
clause = " ORDER BY name"
prefix = None
if 'prefix' in args:
prefix = args['prefix'][0]
prefix = "%s%%" % (prefix)
limit = None
if 'max-keys' in args:
max_a = args['max-keys']
limit = int(max_a[0])
if 'delimiter' in args:
pass
if 'key-marker' in args:
km = args['key-marker'][0]
clause = " and name > '%s'" % (km)
try:
bucket = File.get_file(self.db_obj, bucketName, pynimbusauthz.alias_type_s3)
iter = bucket.get_all_children(limit=limit, match_str=prefix, clause=clause)
new_it = itertools.imap(lambda r: _convert_File_to_cbObject(self, r), iter)
return list(new_it)
finally:
self.db_obj.commit()
开发者ID:xxy-php,项目名称:code,代码行数:27,代码来源:cbAuthzSecurity.py
示例5: exists
def exists(self, bucketName, objectName=None):
pycb.log(logging.INFO, "===== def exists of cbAuthzSecurity.py")
try:
file = self.get_file_obj(bucketName, objectName)
return file != None
finally:
self.db_obj.commit()
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbAuthzSecurity.py
示例6: exists
def exists(self, bucketName, objectName=None):
pycb.log(logging.INFO, "===== def exists of cbPosixSecurity.py")
if objectName == None:
f = self.getBucketPermFile(bucketName)
else:
f = self.getObjectFile(bucketName, objectName)
return os.path.exists(f)
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbPosixSecurity.py
示例7: main
def main(argv=sys.argv[0:]):
pycb.config.parse_cmdline(argv)
cumulus = CumulusRunner()
pycb.log(logging.INFO, "listening at %s" % (str(cumulus.getListener())))
cumulus.run()
return 0
开发者ID:oldpatricka,项目名称:nimbus,代码行数:7,代码来源:cumulus.py
示例8: seek
def seek(self, offset, whence=None):
pycb.log(logging.INFO, "===== def seek of cbPosixBackend.py")
self.seek_count = self.seek_count + 1
pycb.log(logging.WARNING, "Someone is seeking %s %d :: %d" % (self.fname, offset, self.seek_count), tb=traceback)
if self.seek_count > 1:
raise cbException('InternalError')
return self.file.seek(offset, whence)
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbPosixBackend.py
示例9: get_perms
def get_perms(self, bucketName, objectName=None):
pycb.log(logging.INFO, "===== def get_perms of cbPosixSecurity.py")
if objectName == None:
perms = self.getBucketPerms(bucketName)
else:
perms = self.getObjectPerms(bucketName, objectName)
return perms
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbPosixSecurity.py
示例10: deleteIt
def deleteIt(self, data_key):
pycb.log(logging.INFO, "===== def deleteIt of cbRequest.py")
request = self.request
self.set_no_content_header()
self.bucketIface.delete_object(data_key)
self.user.delete_object(self.bucketName, self.objectName)
self.finish(request)
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbRequest.py
示例11: delete_object
def delete_object(self, bucketName, objectName):
pycb.log(logging.INFO, "===== def delete_object of cbAuthzSecurity.py")
try:
file = self.get_file_obj(bucketName, objectName)
file.delete()
finally:
self.db_obj.commit()
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbAuthzSecurity.py
示例12: list_bucket
def list_bucket(self):
pycb.log(logging.INFO, "===== def list_bucket of cbRequest.py")
dirL = self.user.list_bucket(self.bucketName, self.request.args)
doc = Document()
# Create the <wml> base element
xList = doc.createElement("ListBucketResult")
xList.setAttribute("xmlns", "http://doc.s3.amazonaws.com/2006-03-01")
doc.appendChild(xList)
# Create the main <card> element
xName = doc.createElement("Name")
xList.appendChild(xName)
xNameText = doc.createTextNode(str(self.bucketName))
xName.appendChild(xNameText)
xIsTruncated = doc.createElement("IsTruncated")
xList.appendChild(xIsTruncated)
xIsTText = doc.createTextNode('false')
xIsTruncated.appendChild(xIsTText)
for obj in dirL:
xObj = obj.create_xml_element(doc)
xList.appendChild(xObj)
x = doc.toxml();
self.send_xml(x)
self.finish(self.request)
开发者ID:xxy-php,项目名称:code,代码行数:29,代码来源:cbRequest.py
示例13: getText
def getText(nodelist):
pycb.log(logging.INFO, "===== def getText of cbRequest.py")
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbRequest.py
示例14: perm2string
def perm2string(p):
pycb.log(logging.INFO, "===== def perm2string of cbRequest.py")
global perms_strings
for (k, v) in perms_strings.iteritems():
if p == v:
return k
return None
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbRequest.py
示例15: get_uf
def get_uf(self, bucketName, objectName=None):
file = self.get_file_obj(bucketName, objectName)
if file == None:
pycb.log(logging.INFO, "b:o not found %s:%s" % (bucketName, str(objectName)))
raise cbException('NoSuchKey')
uf = UserFile(file, self.user)
return uf
开发者ID:oldpatricka,项目名称:nimbus,代码行数:7,代码来源:cbAuthzSecurity.py
示例16: work
def work(self):
request = self.request
exists = self.user.exists(self.bucketName)
if self.acl:
if not exists:
raise cbException('NoSuchBucket')
(perms, data_key) = self.user.get_perms(self.bucketName)
ndx = perms.find("W")
if ndx < 0:
raise cbException('AccessDenied')
rc = self.grant_public_permissions(self.bucketName, self.objectName)
if not rc:
xml = self.request.content.read()
pycb.log(logging.INFO, "xml %s" % (xml))
grants = parse_acl_request(xml)
for g in grants:
pycb.log(logging.INFO, "granting %s to %s" % (g[2], g[0]))
self.user.grant(g[0], self.bucketName, perms=g[2])
else:
if exists:
raise cbException('BucketAlreadyExists')
self.user.put_bucket(self.bucketName)
self.grant_public_permissions(self.bucketName, self.objectName)
self.set_common_headers()
self.setHeader(request, 'Content-Length', 0)
self.setHeader(request, 'Connection', 'close')
self.setHeader(request, 'Location', "/" + self.bucketName)
self.setResponseCode(request, 200, 'OK')
self.finish(request)
开发者ID:Annatara,项目名称:nimbus,代码行数:33,代码来源:cbRequest.py
示例17: get_info
def get_info(self, bucketName, objectName=None):
pycb.log(logging.INFO, "===== def get_info of cbAuthzSecurity.py")
try:
file = self.get_file_obj(bucketName, objectName)
return (file.get_size(), file.get_creation_time(), file.get_md5sum())
finally:
self.db_obj.commit()
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbAuthzSecurity.py
示例18: create_user
def create_user(self, display_name, id, pw, opts):
pycb.log(logging.INFO, "===== def create_user of cbAuthzSecurity.py")
db_obj = DB(con_str=self.con_str)
user = User(db_obj, friendly=display_name)
user_alias = user.create_alias(id, "s3", display_name, alias_data=pw)
db_obj.commit()
db_obj.close()
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbAuthzSecurity.py
示例19: read_owner_line
def read_owner_line(self, auth_file):
pycb.log(logging.INFO, "===== def read_owner_line of cbPosixSecurity.py")
line = auth_file.readline()
linea = line.split("::", 1)
id = linea[0].strip()
display_name = linea[1].strip()
return (id, display_name)
开发者ID:xxy-php,项目名称:code,代码行数:7,代码来源:cbPosixSecurity.py
示例20: get_remaining_quota
def get_remaining_quota(self):
pycb.log(logging.INFO, "===== def get_remaining_quota of cbAuthzSecurity.py")
quota = self.user.get_quota()
if quota == User.UNLIMITED:
return User.UNLIMITED
u = self.user.get_quota_usage()
return quota - u
开发者ID:xxy-php,项目名称:code,代码行数:8,代码来源:cbAuthzSecurity.py
注:本文中的pycb.log函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论