Imported from archive.
[mudpy.git] / muff / muffvars.py
1 """Global variable objects for the MUFF Engine"""
2
3 # Copyright (c) 2005 mudpy, Jeremy Stanley <fungi@yuggoth.org>, all rights reserved.
4 # Licensed per terms in the LICENSE file distributed with this software.
5
6 # persistent variables are stored in ini-style files supported by ConfigParser
7 import ConfigParser
8
9 # need to be able to create the variable save file's directory
10 import os
11
12 # hack to load all modules in the muff package
13 import muff
14 for module in muff.__all__:
15         exec("import " + module)
16
17 # if there is no userlist, create an empty one
18 try:
19         if userlist: pass
20 except NameError:
21         userlist = []
22
23 # if there is no listening socket, create an empty one
24 try:
25         if newsocket: pass
26 except NameError:
27         newsocket = None
28
29 # flag to raise when the world should be shut down
30 terminate_world = False
31
32 # flag to raise when all code modules, config and data should be reloaded
33 reload_modules = False
34
35 # a dict of replacement macros
36 macros = {
37         "$(eol)": "\r\n",
38         "$(bld)": chr(27) + "[1m",
39         "$(nrm)": chr(27) + "[0m",
40         "$(blk)": chr(27) + "[30m",
41         "$(grn)": chr(27) + "[32m",
42         "$(red)": chr(27) + "[31m"
43         }
44