当前位置: 首页>>代码示例>>Python>>正文


Python Logs.print_current_function_name_and_line_number方法代码示例

本文整理汇总了Python中logs.Logs.print_current_function_name_and_line_number方法的典型用法代码示例。如果您正苦于以下问题:Python Logs.print_current_function_name_and_line_number方法的具体用法?Python Logs.print_current_function_name_and_line_number怎么用?Python Logs.print_current_function_name_and_line_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在logs.Logs的用法示例。


在下文中一共展示了Logs.print_current_function_name_and_line_number方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_not_recommended_count_by_shop

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_not_recommended_count_by_shop(shop):
     try:
         return UserShopRelationMethods.get_by_shop(shop).filter(
             is_recommended=UserShopRelationMethods.NOT_RECOMMENDED).count()
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return 0
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:user_shop_relations.py

示例2: get_user_image

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
    def get_user_image(user):
        result = dict()
        if user:
            if user.userextension.big_image:
                user_image = files.BASE_URL_4_IMAGE + user.userextension.big_image.name
                # Logs.print_log("user_image", user_image)
            else:
                if user.userextension.gender == "M":
                    user_image = USER_DEFAULT_MALE_ICON
                else:
                    user_image = USER_DEFAULT_FEMALE_ICON
        else:
            user_image = USER_DEFAULT_ICON
        memory_file = files.Files.get_memory_file(user_image)
        user_image_path = "/".join(user_image.split("/")[:-1])
        user_image_name = user_image.split("/")[-1]
        big_user_image_name = ".".join(user_image_name.split(".")[:-1]) + "_big." + user_image_name.split(".")[-1]
        small_user_image_name = ".".join(user_image_name.split(".")[:-1]) + "_small." + user_image_name.split(".")[-1]
        big_user_image = user_image_path + "/" + big_user_image_name
        small_user_image = user_image_path + "/" + small_user_image_name
        try:
            Images.resize_image(memory_file, big_user_image, 240)
            Images.resize_image(memory_file, small_user_image, 96)
            result["big_user_image"] = big_user_image
            result["small_user_image"] = small_user_image
        except Exception as ex:
            Logs.print_current_function_name_and_line_number(ex)
            if user.userextension.gender == "M":
                result["big_user_image"] = USER_DEFAULT_MALE_ICON
                result["small_user_image"] = USER_DEFAULT_MALE_ICON
            else:
                result["big_user_image"] = USER_DEFAULT_FEMALE_ICON
                result["small_user_image"] = USER_DEFAULT_FEMALE_ICON

        return result
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:37,代码来源:users.py

示例3: get_attribute_by_user_and_publish

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_attribute_by_user_and_publish(user_id, publish_id):
     try:
         upr = UserPublishRelations.objects.get(user_id=user_id, publish_id=publish_id)
         return upr.attribute
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return -1
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:user_publish_relations.py

示例4: to_utc

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def to_utc(dt):
     try:
         dt = Datetimes.transfer_datetime(dt, is_utc=False)
         return dt.replace(tzinfo=utc)
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:datetimes.py

示例5: set_node_text

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def set_node_text(node, text):
     try:
         node.text = text
         return node
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:xmls.py

示例6: get_memory_file

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_memory_file(url):
     try:
         # Logs.print_log("get memory file url", url)
         return cStringIO.StringIO(urllib2.urlopen(url, data=None, timeout=10).read())
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:files.py

示例7: get_file_content

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_file_content(path):
     try:
         f = open(path, "r")
         return f.read()
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:files.py

示例8: get_publishes_by_device

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_publishes_by_device(device_id):
     try:
         publishes = Publish.objects.filter(device_id=device_id)
         return publishes
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:publishes.py

示例9: get

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get(name):
     try:
         # Logs.print_log("name", name)
         return Company.objects.get(name=name)
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:companies.py

示例10: get_info

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_info(red_envelope):
     try:
         result = Objects.get_object_info(red_envelope)
         return result
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return dict()
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:redenvelopes.py

示例11: set_node_attribute

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def set_node_attribute(node, attribute_key, attribute_value):
     try:
         node.set(attribute_key, attribute_value)
         return node
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:xmls.py

示例12: get_user_extension

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_user_extension(username):
     try:
         u = UserExtension.objects.get(user__username=username)
         return u
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return Users.get_none()
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:users.py

示例13: get_user_by_id

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_user_by_id(user_id):
     try:
         u = User.objects.get(id=user_id)
         return u
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return Users.get_none()
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:users.py

示例14: get_category_id

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_category_id(name):
     try:
         category = ShopCategory.objects.get(name=name)
         return category.id
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return 0
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:shop_categories.py

示例15: get_file_name

# 需要导入模块: from logs import Logs [as 别名]
# 或者: from logs.Logs import print_current_function_name_and_line_number [as 别名]
 def get_file_name(url):
     try:
         names = url.split("/")
         return names[-1]
     except Exception as ex:
         Logs.print_current_function_name_and_line_number(ex)
         return None
开发者ID:appleface2050,项目名称:WorkCode_Bakup,代码行数:9,代码来源:files.py


注:本文中的logs.Logs.print_current_function_name_and_line_number方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。