Shortcuts

API Shortcuts - filesysinfo

The package filesysobjects contains the modules:

The following tables present the shortcut references to the API. The applicable match scope for a filepathname input is displayed in the optional column [scope].

  • L, l: literal
  • R, r: regexpr by ‘re’
  • G, g: ‘glob’

The case of the characters for resolution indicate the processing:

  • L, R, G - Upper case letters indicate active resolution including in-memory processing and filesystem access.
  • l, r, g - Lower case letters indicate passive string acceptance with some in-memory processing.

The optional column [fs] displays whether the filesystem is accessed, or in mem file search path string resolution is performed only. The search path list is supported as literal only. Function calls which access the filesystem are marked in the column ‘[fs]’ with ‘X’.

filesysobjects

The init module of the filesysobjects package contains global definitions.

[docs] [source]
filesysobjects filesysobjects.__init__

filesysobjects.apppaths

The module ‘filesysobjects.apppaths‘ provides for the processing of application resource path names intermixed with file path names, and search paths. This enables for the transparent search and addressing of local and remote resources.

The procedures try to use in-memory access only - scope=lrg - including the static resolution of regular expressions and globs - scope=LRG.

The function interfaces are based on context parameter sets, which is thread safe.

Note

Thread-Safety is not yet sytematically tested.

Process Resource Paths

Syntactically and semantically transform and disassemble resource path names for multiple platforms.

Application Paths

[docs] [source] [scope] [fs] [map]
splitapppathx filesysobjects.apppaths.splitapppathx lrg APPPATHSCANNER
splitapppathx_getlocalpath filesysobjects.apppaths.splitapppathx_getlocalpath lrg APPPATHSCANNER
normapppathx filesysobjects.apppaths.normapppathx lrg APPPATHSCANNER

These interfaces mainly rely on the following scanners and parsers.

Parsers and Scanners

Internal functions for the resolution of the mapping tables via dynamic regular expressions. Based on:

  • APPPATHPARSER, APPPATHINDEX, APPTYPES [doc]

filesysobjects.paths

The module ‘filesysobjects.paths‘ provides for the processing of path names, file path names, and search paths. This is mainly based on the in-memory syntax analysis - scope=lrg, and includes in addition the static resolution of regular expressions and globs - scope=LRG.

The calculation of canonicial resources is provided by function interfaces and path classes. The implementation is based on the standard re package, with static compiled regexpr and callback based dynamic evaluation of the regular expressions.

The function interfaces are based on context parameter sets, which is thread safe.

Note

Thread-Safety is not yet sytematically tested.

Process Resource Paths

Syntactically and semantically transform and disassemble file resource path names for multiple platforms.

Paths

[docs] [source] [scope] [fs]
escapepathx filesysobjects.paths.escapepathx lg
getspf filesysobjects.paths.getspf
gettpf filesysobjects.paths.gettpf
normpathx filesysobjects.paths.normpathx l
splitpathx filesysobjects.paths.splitpathx lrg
unescapepathx filesysobjects.paths.unescapepathx lg

These interfaces mainly rely on the following scanners and parsers.

Parsers and Scanners

Internal functions for the resolution of the mapping tables via dynamic regular expressions. Based on:

  • PATHSCANNER, ASCII_SC_CTRL [doc]

The following parser and scanner maps apply.

[docs] [source] [scope] [fs] [map]
sub_esc filesysobjects.paths.sub_esc lg PATHSCANNER, ASCII_SC_CTRL
sub_keep filesysobjects.paths.sub_keep lg  
sub_posix filesysobjects.paths.sub_posix lg PATHSCANNER, ASCII_SC_CTRL
sub_win filesysobjects.paths.sub_win lg PATHSCANNER, ASCII_SC_CTRL
sub_unesc filesysobjects.paths.sub_unesc lg PATHSCANNER, ASCII_SC_CTRL

Remarks:

  • In general: roll-back operations for conversions are not provided.
  • strip: A conversion with the strip option could not be reverted.
  • sub_unesc: Simply removes escape masks, is context aware. Application on e.g. non-escaped NTFS paths containing separators ‘\’ leads to unpredictable results. While the application onto previously escaped paths is reversable.
  • revert: A literal revert is not supported, but each valid path representation could be converted to one of the other provided options and vice versa.

Note

The scanners and parsers/path-compilers support the masking by quoting. Quoted segments of a pathname are kept literally as part of a nodename. These could be excluded e.g. from escaping by option. Thus can include any character, so also regular expressions and globs.

filesysobjects.pathtools

The module filesysobjects.pathtools supports the dynamic evaluation by creation of

Filesystem Positions and Navigation for sys.path, and extended alternatives. [docs] [API]

Miscellaneous

[docs] [source]
glob_to_re filesysobjects.pathtools.glob_to_re

filesysobjects.osdata

Search path object for OS specific configurations. [docs] [API]

[docs] [source] [scope] [fs]
getdir_osconfigdata filesysobjects.osdata.getdir_osconfigdata lrg
getdir_osappdata filesysobjects.osdata.getdir_osappdata lrg
getdir_osappconfigdata filesysobjects.osdata.getdir_osappconfigdata lrg

netfiles.net_normpathx

For now experimental and non-productive, for review and comments [docs]

[docs] [source] [scope] [fs]
net_normpathx netfiles.net_normpathx    

Tests

The tests are base on PyUnit and Eclipse. These are contained in the subdirectory tests and optionally in the subdirectory UseCases.

The test cases are in particular based on normative input data arrays - data.py, and related normative result arrays. With additional explicit test cases. The contained tests at the time of writing is in total about 4400 test-cases.