globalvars.py: new GlobalConstants (gc), GlobalVars (gv) classes
- The attributes of GlobalConstants are non-configurable. They’re constant for a given machine, user, executable and MMGen release. - The attributes of GlobalVars, `stderr` and `stdout`, are used by the test suite to redirect msg() and friends to /dev/null. - All the aforementioned attributes formerly belonged to GlobalConfig.
This commit is contained in:
parent
19f0730913
commit
c3ce1ab8e3
70 changed files with 309 additions and 282 deletions
|
|
@ -19,7 +19,7 @@
|
|||
import sys,os
|
||||
|
||||
import mmgen.opts as opts
|
||||
from mmgen.globalvars import g
|
||||
from mmgen.globalvars import gc
|
||||
from mmgen.util import msg,die
|
||||
|
||||
def normalize_path(p):
|
||||
|
|
@ -53,7 +53,7 @@ opts_data = {
|
|||
|
||||
cmd_args = opts.init(opts_data)
|
||||
|
||||
if g.platform == 'linux' and os.getenv('USER') != 'root':
|
||||
if gc.platform == 'linux' and os.getenv('USER') != 'root':
|
||||
die(1,'This program must be run as root')
|
||||
|
||||
if len(cmd_args):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue