example_helpers.py 文件源码

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

项目:cbapi-python 作者: carbonblack 项目源码 文件源码
def _file_path_fixup(self, path):
        '''
        We have a pseudo-cwd that we use to
        base off all commands.  This means we
        need to figure out if a given path is relative,
        absolute, or file relative and calculate against
        the pseudo cwd.

        This function takes in a given file path arguemnt
        and performs the fixups.
        '''


        if (self._is_path_absolute(path)):
            return path
        elif (self._is_path_drive_relative(path)):
            return self.cwd[:2] + path
        else:
            return ntpath.join(self.cwd + '\\', path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号