Package web2py :: Package gluon :: Module fileutils
[hide private]
[frames] | no frames]

Module fileutils

source code

This file is part of web2py Web Framework (Copyrighted, 2007-2010). Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>. License: GPL v2

Functions [hide private]
 
listdir(path, expression='^.+$', drop=True, add_dirs=False)
like os.listdir() but you can specify a regex patter to filter filed.
source code
 
cleanpath(path)
turns any expression/path into a valid filename.
source code
 
_extractall(filename, path='.', members=None) source code
 
tar(file, dir, expression='^.+$')
tars dir into file, only tars file that match expression
source code
 
untar(file, dir)
untar file into dir
source code
 
w2p_pack(filename, path, compiled=False) source code
 
w2p_unpack(filename, path, delete_tar=True) source code
 
w2p_pack_plugin(filename, path, plugin_name)
Pack the given plugin into a w2p file.
source code
 
w2p_unpack_plugin(filename, path, delete_tar=True) source code
 
tar_compiled(file, dir, expression='^.+$')
used to tar a compiled application.
source code
 
up(path) source code
 
get_session(request, other_application='admin')
checks that user is authorized to access other_application
source code
 
check_credentials(request, other_application='admin')
checks that user is authorized to access other_application
source code
 
fix_newlines(path) source code
 
copystream(src, dest, size, chunk_size=100000)
this is here because I think there is a bug in shutil.copyfileobj
source code
Function Details [hide private]

listdir(path, expression='^.+$', drop=True, add_dirs=False)

source code 

like os.listdir() but you can specify a regex patter to filter filed. if add_dirs==True the returned items will have the full path.

cleanpath(path)

source code 

turns any expression/path into a valid filename. replaces / with _ and removes special characters.

w2p_pack_plugin(filename, path, plugin_name)

source code 
Pack the given plugin into a w2p file.
Will match files at:
    <path>/*/plugin_[name].*
    <path>/*/plugin_[name]/*

tar_compiled(file, dir, expression='^.+$')

source code 

used to tar a compiled application. the content of models, views, controllers is not stored in the tar file.