Conditions | 5 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | #!/usr/bin/env python |
||
34 | if os.path.isfile(filename): |
||
35 | return filename |
||
36 | |||
37 | command = sys.argv[0] |
||
38 | if '/' != command[0]: |
||
39 | command = os.path.normpath(os.path.join(os.getcwd(), command)) |
||
40 | path = os.path.join(os.path.dirname(os.path.dirname(command)), 'etc', filename) |
||
41 | if os.path.isfile(path): |
||
42 | return path |
||
43 | |||
44 | if ':' in filename: |
||
45 | return cls.findFile(filename.split(':', 1)[0]) |
||
46 | |||
47 | ext = os.path.splitext(filename)[1] |
||
48 | |||
49 | if ext != '.json': |
||
50 | return cls.findFile(filename + '.json') |
||
51 | else: |
||
54 |