Package XPyLIB :: Module pckgmisc
[hide private]
[frames] | no frames]

Module pckgmisc

source code

Miscelaneous functions for packages.

Functions [hide private]
string
GetObjectDocs(obj)
Return first docs strings from objects item.
source code
None
ExtendPaths(sPath, *lRelPaths)
Combine sPath to each path from relative path list.
source code
str
cutarch(path, arch='.zip')
If path path end with arch file then remove this file and return path without arch.
source code

Imports: inspect, os


Function Details [hide private]

GetObjectDocs(obj)

source code 
Return first docs strings from objects item.
Parameters:
  • obj (object) - Object to introspection. Item may be modules, classes, functions.
Returns: string
First docs strings from objects item.

Note: Get docs for all objects, include imported.

ExtendPaths(sPath, *lRelPaths)

source code 
Combine sPath to each path from relative path list.
Parameters:
  • sPath (list) - List with item[0] = base path. It's list will be extended. [in/out] parametr.
  • lRelPaths (*string) - Arguments list of relative paths.
Returns: None
Combined sPath to each path from relative path list in the sPath.

cutarch(path, arch='.zip')

source code 

If path path end with arch file then remove this file and return path without arch.

For define archive test ends of path and if it equal arch then archive is defined.

For example if path = 'c:/lib/pack.zip' then return 'c:/lib'.
Parameters:
  • path (str) - Path.
  • arch (str = {'.zip'}) - Archive type.
Returns: str
Path without archive at end.