Skip to content

bahejl/pypaths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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
>> 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages