Send warnings to stderr rather than stdout
svn: r13537
This commit is contained in:
@ -33,6 +33,7 @@ This package implements access to GRAMPS configuration.
|
|||||||
#
|
#
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import errno
|
import errno
|
||||||
@ -179,13 +180,13 @@ class ConfigManager(object):
|
|||||||
if vtype == bool:
|
if vtype == bool:
|
||||||
value = raw_value in ["1", "True"]
|
value = raw_value in ["1", "True"]
|
||||||
elif vtype == list:
|
elif vtype == list:
|
||||||
print "WARNING: ignoring old key '%s'" % key
|
print >> sys.stderr, "WARNING: ignoring old key '%s'" % key
|
||||||
continue # there were no lists in oldstyle
|
continue # there were no lists in oldstyle
|
||||||
else:
|
else:
|
||||||
value = vtype(raw_value)
|
value = vtype(raw_value)
|
||||||
else:
|
else:
|
||||||
# else, ignore it
|
# else, ignore it
|
||||||
print "WARNING: ignoring old key '%s'" % key
|
print >> sys.stderr, "WARNING: ignoring old key '%s'" % key
|
||||||
continue # with next setting
|
continue # with next setting
|
||||||
####################### End upgrade code
|
####################### End upgrade code
|
||||||
else:
|
else:
|
||||||
@ -196,7 +197,7 @@ class ConfigManager(object):
|
|||||||
if type(value) == type(self.default[name][setting]):
|
if type(value) == type(self.default[name][setting]):
|
||||||
self.data[name][setting] = value
|
self.data[name][setting] = value
|
||||||
else:
|
else:
|
||||||
print ("WARNING: ignoring key with wrong type "
|
print >> sys.stderr, ("WARNING: ignoring key with wrong type "
|
||||||
"'%s.%s'" % (name, setting))
|
"'%s.%s'" % (name, setting))
|
||||||
else:
|
else:
|
||||||
# this could be a third-party setting; add it:
|
# this could be a third-party setting; add it:
|
||||||
@ -659,10 +660,10 @@ if not os.path.exists(CONFIGMAN.filename):
|
|||||||
# If not, let's read old if there:
|
# If not, let's read old if there:
|
||||||
if os.path.exists(os.path.join(const.HOME_DIR, "keys.ini")):
|
if os.path.exists(os.path.join(const.HOME_DIR, "keys.ini")):
|
||||||
# read it in old style:
|
# read it in old style:
|
||||||
print "Importing old key file 'keys.ini'..."
|
print >> sys.stderr, "Importing old key file 'keys.ini'..."
|
||||||
CONFIGMAN.load(os.path.join(const.HOME_DIR, "keys.ini"),
|
CONFIGMAN.load(os.path.join(const.HOME_DIR, "keys.ini"),
|
||||||
oldstyle=True)
|
oldstyle=True)
|
||||||
print "Done importing old key file 'keys.ini'"
|
print >> sys.stderr, "Done importing old key file 'keys.ini'"
|
||||||
# other version upgrades here...
|
# other version upgrades here...
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
#---------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user