Add all backends at once
When no backends are loaded, a prompt pops up and suggest to add some. This patch adds the possibility to select all at once. Signed-off-by: theo <theocrite@theocrite.org> Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
parent
65497fe91b
commit
6f27b02865
1 changed files with 12 additions and 1 deletions
|
|
@ -138,8 +138,9 @@ class ConsoleApplication(BaseApplication):
|
||||||
loaded += 1
|
loaded += 1
|
||||||
print '%s%d)%s [%s] %s%-15s%s %s' % (self.BOLD, len(modules), self.NC, loaded,
|
print '%s%d)%s [%s] %s%-15s%s %s' % (self.BOLD, len(modules), self.NC, loaded,
|
||||||
self.BOLD, name, self.NC, info.description)
|
self.BOLD, name, self.NC, info.description)
|
||||||
|
print '\n%sa) --all--%s install all backends\n' % (self.BOLD, self.NC)
|
||||||
print '%sq)%s --stop--\n' % (self.BOLD, self.NC)
|
print '%sq)%s --stop--\n' % (self.BOLD, self.NC)
|
||||||
r = self.ask('Select a backend to create (q to stop)', regexp='^(\d+|q)$')
|
r = self.ask('Select a backend to create (q to stop)', regexp='^(\d+|q|a)$')
|
||||||
|
|
||||||
if str(r).isdigit():
|
if str(r).isdigit():
|
||||||
i = int(r) - 1
|
i = int(r) - 1
|
||||||
|
|
@ -153,6 +154,16 @@ class ConsoleApplication(BaseApplication):
|
||||||
self.load_backends(names=[inst])
|
self.load_backends(names=[inst])
|
||||||
except (KeyboardInterrupt, EOFError):
|
except (KeyboardInterrupt, EOFError):
|
||||||
print '\nAborted.'
|
print '\nAborted.'
|
||||||
|
if r == 'a':
|
||||||
|
for i in range( len(modules) ):
|
||||||
|
name = modules[i]
|
||||||
|
print "\n%sInstalling %s%s" % (self.BOLD, name, self.NC)
|
||||||
|
try:
|
||||||
|
inst = self.add_backend(name, default_config)
|
||||||
|
if inst:
|
||||||
|
self.load_backends(names=[inst])
|
||||||
|
except (KeyboardInterrupt, EOFError):
|
||||||
|
print '\nAborted.'
|
||||||
|
|
||||||
print 'Right right!'
|
print 'Right right!'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue