Bug 957911 - Remove config/configobj.py: keep comm-central in sync. rs,a=bustage-fix on CLOSED TREE
--HG-- extra : rebase_source : c8df81909e6230ae47cc530b99a0f9b4f3c5a001
This commit is contained in:
Родитель
9d168e83df
Коммит
e3b7def881
2279
config/configobj.py
2279
config/configobj.py
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -2,7 +2,10 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
import configobj, sys
|
import configobj
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
|
from StringIO import StringIO
|
||||||
|
|
||||||
try:
|
try:
|
||||||
(file, section, key) = sys.argv[1:]
|
(file, section, key) = sys.argv[1:]
|
||||||
|
@ -10,7 +13,10 @@ except ValueError:
|
||||||
print "Usage: printconfigsetting.py <file> <section> <setting>"
|
print "Usage: printconfigsetting.py <file> <section> <setting>"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
c = configobj.ConfigObj(file)
|
with open(file) as fh:
|
||||||
|
content = re.sub('^\s*;', '#', fh.read(), flags=re.M)
|
||||||
|
|
||||||
|
c = configobj.ConfigObj(StringIO(content))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = c[section]
|
s = c[section]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче