How to use tgMochiKit - 1 common examples

To help you get started, we’ve selected a few tgMochiKit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beaker-project / beaker / Server / bkr / server / wsgi.py View on Github external
# If rlimit_as is defined in the config file then set the limit here.
    if config.get('rlimit_as'):
        import resource
        resource.setrlimit(resource.RLIMIT_AS, (config.get('rlimit_as'),
                                                config.get('rlimit_as')))

    # Build assets. If assets.auto_build is True in the config, this will also
    # happen on page request. Otherwise, it only happens once at startup here.
    assets.build_assets()

    # workaround for TGMochiKit initialisation
    # https://sourceforge.net/p/turbogears1/tickets/34/
    import tgmochikit
    from turbogears.widgets.base import register_static_directory
    tgmochikit.init(register_static_directory, config)

    # Global device class list... a terrible hack, desperately needs deleting
    from bkr.server import model
    with session.begin():
        model.device_classes = [c.device_class for c in model.DeviceClass.query]

    log.debug('Application initialised')

tgMochiKit

MochiKit packaged as TurboGears widgets.

MIT
Latest version published 15 years ago

Package Health Score

42 / 100
Full package analysis

Popular tgMochiKit functions

Similar packages