本文整理汇总了Python中pycb.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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)
示例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
示例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()
示例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()
示例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)
示例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
示例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)
示例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
示例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)
示例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()
示例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)
示例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
示例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
示例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