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

# Module admin

source code
This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)

# Utility functions for the Admin application

Functions | [hide private]
apath(path=`'````'`, r=1) Builds a path inside an application folder... | source code
app_pack(app, request) Builds a w2p package for the application... | source code
app_pack_compiled(app, request) Builds a w2p bytecode-compiled package for the application... | source code
app_cleanup(app, request) Removes session, cache and error files... | source code
app_compile(app, request) Compiles the application... | source code
app_create(app, request, force=True, key=1) Create a copy of welcome.w2p (scaffolding) app... | source code
app_install(app, fobj, request, filename, overwrite=1) Installs an application: - Identifies file type by filename - Writes `fobj` contents to the `../deposit/` folder - Calls `w2p_unpack()` to do the job. | source code
app_uninstall(app, request) Uninstalls the application. | source code
plugin_pack(app, plugin_name, request) Builds a w2p package for the application... | source code
plugin_install(app, fobj, request, filename) Installs an application: - Identifies file type by filename - Writes `fobj` contents to the `../deposit/` folder - Calls `w2p_unpack()` to do the job. | source code
check_new_version(myversion, version_URL) Compares current web2py's version with the latest stable web2py version. | source code
unzip(filename, dir, subfolder=`'````'`) Unzips filename into dir (.zip only, no .gz etc) if subfolder!='' it unzip only files in subfolder | source code
upgrade(request, url=`'``http://web2py.com``'`) Upgrades web2py (src, osx, win) is a new version is posted. | source code
add_path_first(path) | source code
create_missing_folders() | source code
create_missing_app_folders(request) | source code

Function Details | [hide private]

### apath(path=`'````'`, r=1) | source code
    Builds a path inside an application folder

    Parameters
    ----------
    path:
        path within the application folder
    r:
        the global request object

### app_pack(app, request) | source code
    Builds a w2p package for the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object

    Returns
    -------
    filename:
        filename of the w2p file or None on error

### app_pack_compiled(app, request) | source code
    Builds a w2p bytecode-compiled package for the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object

    Returns
    -------
    filename:
        filename of the w2p file or None on error

### app_cleanup(app, request) | source code
    Removes session, cache and error files

    Parameters
    ----------
    app:
        application name
    request:
        the global request object

### app_compile(app, request) | source code
    Compiles the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object

### app_create(app, request, force=True, key=1) | source code
    Create a copy of welcome.w2p (scaffolding) app

    Parameters
    ----------
    app:
        application name
    request:
        the global request object

### app_install(app, fobj, request, filename, overwrite=1) | source code
    Installs an application:

    - Identifies file type by filename
    - Writes `fobj` contents to the `../deposit/` folder
    - Calls `w2p_unpack()` to do the job.

    Parameters
    ----------
    app:
        new application name
    fobj:
        file object containing the application to be installed
    request:
        the global request object
    filename:
        original filename of the `fobj`, required to determine extension

    Returns
    -------
    upname:
        name of the file where app is temporarily stored or `None` on failure

### app_uninstall(app, request) | source code
    Uninstalls the application.

    Parameters
    ----------
    app:
        application name
    request:
        the global request object

    Returns
    -------
    `True` on success, `False` on failure

### plugin_pack(app, plugin_name, request) | source code
    Builds a w2p package for the application

    Parameters
    ----------
    app:
        application name
    plugin_name:
        the name of the plugin without plugin_ prefix
    request:
        the current request app

    Returns
    -------
    filename:
        filename of the w2p file or None on error

### plugin_install(app, fobj, request, filename) | source code
    Installs an application:

    - Identifies file type by filename
    - Writes `fobj` contents to the `../deposit/` folder
    - Calls `w2p_unpack()` to do the job.

    Parameters
    ----------
    app:
        new application name
    fobj:
        file object containing the application to be installed
    request:
        the global request object
    filename:
        original filename of the `fobj`, required to determine extension

    Returns
    -------
    upname:
        name of the file where app is temporarily stored or `None` on failure

### check_new_version(myversion, version_URL) | source code
    Compares current web2py's version with the latest stable web2py version.

    Parameters
    ----------
    myversion:
        the current version as stored in file `web2py/VERSION`
    version_URL:
        the URL that contains the version of the latest stable release

    Returns
    -------
    state:
        `True` if upgrade available, `False` if current version if up-to-date,
        -1 on error
    version:
        the most up-to-version available

### upgrade(request, url=`'``http://web2py.com``'`) | source code
    Upgrades web2py (src, osx, win) is a new version is posted.
    It detects whether src, osx or win is running and downloads the right one

    Parameters
    ----------
    request:
        the current request object, required to determine version and path
    url:
        the incomplete url where to locate the latest web2py
        actual url is url+'/examples/static/web2py_(src|osx|win).zip'

    Returns
    -------
        True on success, False on failure (network problem or old version)