-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
49 lines (44 loc) · 1.46 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
The goal for this project is to be able to treat paths as a type of container for
other paths. For example, directories are containers for other directories and
files, files are containers for data.
It would be reasonable to extend this to say that, for example, .c files are
containers for preprocessor directives, C LOC and C functions, and that C functions
are containers for C LOC.
Instead of working purely with the textual representation of a path, it would be
nice to be able to treat it as an object. For example, to iterate over all of
the contents of a directory:
>> for i in DIRECTORY:
#Do something
>> for common_path in DIR1 & DIR2:
#Do something
* Need to support both absolute and relative paths
** are '.' and '..' important to this?
* Need to support all of the os(.path) functionality
** http://docs.python.org/library/filesys.html
** set operators to correspond to filecmp/dircmp classes?
* Also support open() functionality?
* Extend dircmp functionality with the stuff in difflib
* metadata
* Functionality of relative paths:
FileSystem relative path?
More specific relative paths? eg CRelativePath?
Support '..', '.', etc?
>> p1 = get_fs_path(...)
>> p2 = get_fs_path(p1, base=p1.parent)
>> p2.children
None
>> p2.parent
XXXPath(...)
>> p2.parent.children
None
>> p2.parent.parent
None
>> p1 + p2
OSError: ...
>> p1 + p1.parent
NotImplemented: ... # only relative paths can be added
>> p3 = p1.parent.parent + p2
XXXPath(...)
>> p1 is p3
True
>>