Package gavo :: Package helpers :: Module filestuff
[frames] | no frames]

Module filestuff

source code

File- and directory related helpers for resource utilites.

Classes
  Error
  FileRenamer
is a name mapper for file rename operations and the like.
Functions
 
stingySplitext(fName)
returns name, extension for fName.
source code
 
iterSources(ddId, args=[])
iterates over the current sources of the data descriptor ddId (which is qualified like rdId#id
source code
Variables
  fnamePat = re.compile(r'([^\.]*)(\..*)')
  __package__ = 'gavo.helpers'
Function Details

stingySplitext(fName)

source code 

returns name, extension for fName.

The main difference to os.path.splitext is that the main name is not allowed to contain dots and the extension can contain more than one dot.

fName is supposed to be a single file name without any path specifier (you might get aways with it if your directores do not contain dots, though).

iterSources(ddId, args=[])

source code 

iterates over the current sources of the data descriptor ddId (which is qualified like rdId#id

If you pass something nonempty to args, an iterator over its values will be returned. This is for convenient implementation of scripts that work on CL arguments if given, on all files otherwise.