~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to bin/ivle-config

  • Committer: David Coles
  • Date: 2010-08-30 03:26:13 UTC
  • Revision ID: coles.david@gmail.com-20100830032613-d14vng0jkelniu3l
python-console: Fix globals broken with new JSON library.

simplejson always returns unicode strings. cJSON would return ordinary strings 
if possible. cPickle.loads() only accepts strings. At present we use pickle 
version 0 so they should all works as ASCII strings. Higher versions of pickle 
are not plain ASCII and are likely to break this and so this should be fixed 
at some point.

Also replaced unconditional exception with one that catches Pickle errors. Not 
sure the best way to report failures of these functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
    """
204
204
# The password for the usrmgt-server.""", ask=False))
205
205
 
 
206
config_options.append(ConfigOption("jail/suite", "hardy",
 
207
    """The distribution release to use to build the jail:""",
 
208
    """
 
209
# The distribution release to use to build the jail.""", ask=True))
 
210
 
 
211
config_options.append(ConfigOption("jail/mirror", "archive.ubuntu.com",
 
212
    """The archive mirror to use to build the jail:""",
 
213
    """
 
214
# The archive mirror to use to build the jail.""", ask=True))
 
215
 
 
216
config_options.append(ConfigOption("jail/devmode", False,
 
217
    """Whether jail development mode be activated:""",
 
218
    """
 
219
# Should jail development mode be activated?""", ask=False))
 
220
 
 
221
# The password for the usrmgt-server.""", ask=False))
206
222
def query_user(default, prompt):
207
223
    """Prompts the user for a string, which is read from a line of stdin.
208
224
    Exits silently if EOF is encountered. Returns the string, with spaces
282
298
    (opts, args) = getopt.gnu_getopt(args, "", optnames)
283
299
 
284
300
    if args != []:
285
 
        print >>sys.stderr, "Invalid arguments:", string.join(args, ' ')
 
301
        print >>sys.stderr, "Invalid arguments:", ' '.join(args)
286
302
        return 2
287
303
 
288
304
    if opts == []: