示例#1
0
def test_get_file_ext():
    s = '\n'
    s += 'abc         = ' + util.get_file_ext('abc') + '\n'
    s += 'abc.ext     = ' + util.get_file_ext('abc.ext') + '\n'
    s += 'abc.def.ext = ' + util.get_file_ext('abc.def.ext') + '\n'
    s += 'aaa/abc     = ' + util.get_file_ext('aaa/abc') + '\n'
    s += 'aaa/abc/    = ' + util.get_file_ext('aaa/abc/') + '\n'
    s += 'aaa/abc.ext = ' + util.get_file_ext('aaa/abc.ext') + '\n'
    s += 'aaa\\abc     = ' + util.get_file_ext('aaa\\abc') + '\n'
    s += 'aaa\\abc.ext = ' + util.get_file_ext('aaa\\abc.ext') + '\n'
    s += 'aaa\\abc.def\\xyz.ext = ' + util.get_file_ext(
        'aaa\\abc.def\\xyz.ext') + '\n'
    return s
示例#2
0
文件: dbx.py 项目: d5/daniel.gs
    def ext(self):
        if self.is_dir:
            raise Exception("The path is a directory: " + self.path)

        return get_file_ext(self.path)