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


Python LOG.traceback方法代码示例

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


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

示例1: rm

# 需要导入模块: from atve.log import LOG [as 别名]
# 或者: from atve.log.LOG import traceback [as 别名]
 def rm(self, filepath):
     if not type(filepath) in STRING_SET:
         raise WorkspaceError("filepath must be strings.")
     if not os.path.exists(filepath):
         L.warning("it is not exists %s" % filepath)
     else:
         try:
             os.remove(filepath)
             return filepath
         except Exception as e:
             L.traceback()
             raise WorkspaceError("Can't remove file %s. Please Check File Permission." % filepath)
开发者ID:TE-ToshiakiTanaka,项目名称:atve,代码行数:14,代码来源:workspace.py

示例2: __init__

# 需要导入模块: from atve.log import LOG [as 别名]
# 或者: from atve.log.LOG import traceback [as 别名]
 def __init__(self, path, clear=False):
     if not type(path) in STRING_SET:
         raise WorkspaceError("path must be strings.")
     self.default_path = os.path.abspath(path)
     if os.path.exists(path):
         if len(os.listdir(path)) > 0:
             L.warning("It is not vacant folder in the path.")
             if clear:
                 try:
                     for f in os.listdir(path):
                         shutil.rmtree(os.path.join(path, f))
                 except Exception as e:
                     L.traceback()
                     raise WorkspaceError("it must be vacant folder in the path.")
     else:
         self._mkdir_recursive(self.default_path)
开发者ID:TE-ToshiakiTanaka,项目名称:atve,代码行数:18,代码来源:workspace.py

示例3: rmdir

# 需要导入模块: from atve.log import LOG [as 别名]
# 或者: from atve.log.LOG import traceback [as 别名]
    def rmdir(self, folder, host=""):
        if not type(folder) in STRING_SET:
            raise WorkspaceError("folder must be strings.")

        if host == "":
            path = os.path.join(self.root(), folder)
        else:
            if not os.path.exists(host):
                L.warning("it is not exists %s" % host)
                return host
            path = os.path.join(host, folder)

        if not os.path.exists(path):
            L.warning("it is not exists %s" % path)
            return path
        else:
            try:
                shutil.rmtree(path); return path
            except Exception as e:
                L.traceback()
                raise WorkspaceError("Can't remove file %s. Please Check File Permission." % path)
开发者ID:TE-ToshiakiTanaka,项目名称:atve,代码行数:23,代码来源:workspace.py

示例4: mkdir

# 需要导入模块: from atve.log import LOG [as 别名]
# 或者: from atve.log.LOG import traceback [as 别名]
    def mkdir(self, folder, host="", clear=False):
        if not type(folder) in STRING_SET:
            raise WorkspaceError("folder must be strings.")
        if host == "":
            path = os.path.join(self.root(), folder)
        else:
            if not os.path.exists(host): self._mkdir_recursive(host)
            path = os.path.join(host, folder)

        if os.path.exists(path):
            if len(os.listdir(path)) > 0:
                L.warning("It is not vacant folder in the path.")
                if clear:
                    try:
                        for f in os.listdir(path):
                            shutil.rmtree(os.path.join(path, f))
                    except Exception as e:
                        L.traceback()
                        raise WorkspaceError("it must be vacant folder in the path.")
        else:
            self._mkdir_recursive(path)
        return path
开发者ID:TE-ToshiakiTanaka,项目名称:atve,代码行数:24,代码来源:workspace.py


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