mewlo.mpacks.core.mglobals module

mglobals.py This file contains classes to handle Mewlo sites and site manager.any globals the system uses

We want to avoid the use of global variables like the plague
but there are some rare scenarios where we have a quantity that we may need to access from any arbitrary function and where it’s just not practical to pass around objects to facilitate lookup
Use:

from mewlo.mpacks.core.mglobals import mewlosite site = mewlosite()

All mewlo globals go in this dictionary But as a point of fact, i think we prefer to have NO globals other than the site, and let the site object hold anything else that might otherwise be considered a “global”

ATTN: As of 1/17/14 - we do NOT actually currently use any of these globals (yay). You can see that by the ‘UNUSED_‘ prefix on the get accessor functions. I’m leaving this code for now – it’s conceivable that we would still want to use this, rarely, in some logging error situation where we don’t have context.

class mewlo.mpacks.core.mglobals.MewloGlobalClass[source]
globals = {'site': None}
classmethod onimport()[source]
mewlo.mpacks.core.mglobals.UNUSED_db()[source]

Return reference to site database manager.

mewlo.mpacks.core.mglobals.UNUSED_debugmode()[source]

Return True if debugmode is enabled – note that we let the SITE track the actual debugmode variable.

mewlo.mpacks.core.mglobals.UNUSED_mewlosite()[source]

Return the global MewloSite reference.

mewlo.mpacks.core.mglobals.UNUSED_notfinished(msg)[source]

Shortcut function to log a not finished message.

mewlo.mpacks.core.mglobals.set_debugmode(val)[source]

Set global (site) debugmode.

mewlo.mpacks.core.mglobals.set_mewlosite(val)[source]

Set global MewloSite reference (other “globals” depend on this).