7 |
7 |
8 """ |
8 """ |
9 |
9 |
10 from constants.VERSION import * |
10 from constants.VERSION import * |
11 |
11 |
12 import locale |
|
13 import sys |
|
14 from shutil import copy2 |
12 from shutil import copy2 |
15 from ConfigParser import ConfigParser, MissingSectionHeaderError, ParsingError |
13 from ConfigParser import ConfigParser, MissingSectionHeaderError, ParsingError |
16 from cStringIO import StringIO |
14 from cStringIO import StringIO |
17 |
15 |
|
16 from __main__ import ENCODING, w_std |
18 from Exceptions import VMMConfigException |
17 from Exceptions import VMMConfigException |
19 import constants.ERROR as ERR |
18 import constants.ERROR as ERR |
20 |
|
21 locale.setlocale(locale.LC_ALL, '') |
|
22 ENCODING = locale.nl_langinfo(locale.CODESET) |
|
23 |
|
24 def w_std(*args): |
|
25 for arg in args: |
|
26 sys.stdout.write(arg.encode(ENCODING, 'replace')) |
|
27 sys.stdout.write('\n') |
|
28 |
19 |
29 class Config(ConfigParser): |
20 class Config(ConfigParser): |
30 """This class is for reading and modifying vmm's configuration file.""" |
21 """This class is for reading and modifying vmm's configuration file.""" |
31 |
22 |
32 def __init__(self, filename): |
23 def __init__(self, filename): |