Skip to content

Commit

Permalink
[config] Correct spacing on prompts per issue #190
Browse files Browse the repository at this point in the history
Also minor line length fixes per issue #125
  • Loading branch information
embolalia committed Mar 4, 2013
1 parent a1db920 commit f485e27
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions willie/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
The Willie config file is divided to sections, and each section contains keys
and values. A section is an attribute of the config class, and is of type
``ConfigSection``. Each section contains the keys as attributes. For example,
if you want to access key example from section test, use
if you want to access key example from section test, use
``config.test.example``. Note that the key names are made lower-case by the
parser, regardless of whether they are upper-case in the file.
Expand All @@ -22,14 +22,14 @@
the config class as well as of config.core. For new code, always specify the
name of the section, because this behavior might be removed in the future.
Running the ``config.py`` file directly will give the user an interactive series
of dialogs to create the configuration file. This will guide the user through
creating settings for the Willie core, the settings database, and any modules
which have a configuration function.
Running the ``config.py`` file directly will give the user an interactive
series of dialogs to create the configuration file. This will guide the user
through creating settings for the Willie core, the settings database, and any
modules which have a configuration function.
The configuration function, if used, must be declared with the signature
``configure(config)``. To add options, use ``interactive_add``, ``add_list`` and
``add_option``.
``configure(config)``. To add options, use ``interactive_add``, ``add_list``
and ``add_option``.
"""
"""
Config - A config class and writing/updating utility for Willie
Expand Down Expand Up @@ -221,10 +221,10 @@ def add_list(self, section, option, message, prompt):
m = "You currently have " + self.parser.get(section, option)
if self.option(m + '. Would you like to keep them', True):
lst = self.parser.get(section, option)
mem = raw_input(prompt)
mem = raw_input(prompt + ' ')
while mem:
lst.append(mem)
mem = raw_input(prompt)
mem = raw_input(prompt + ' ')
self.parser.set(section, option, ','.join(lst))

def add_option(self, section, option, question, default=False):
Expand Down Expand Up @@ -253,7 +253,7 @@ def option(self, question, default=False):
d = 'n'
if default:
d = 'y'
ans = raw_input(question + ' (y/n)? [' + d + ']')
ans = raw_input(question + ' (y/n)? [' + d + '] ')
if not ans:
ans = d
return (ans is 'y' or ans is 'Y')
Expand Down

0 comments on commit f485e27

Please sign in to comment.