server/utils.py
branchstable
changeset 2105 92ea410806fe
parent 1977 606923dff11b
child 2708 60d728bdcba5
--- a/server/utils.py	Fri Jun 12 16:31:32 2009 +0200
+++ b/server/utils.py	Fri Jun 12 16:33:19 2009 +0200
@@ -13,6 +13,10 @@
 from getpass import getpass
 from random import choice
 
+from logilab.common.configuration import Configuration
+
+from cubicweb.server import SOURCE_TYPES
+
 try:
     from crypt import crypt
 except ImportError:
@@ -83,6 +87,13 @@
     return user, passwd
 
 
+def ask_source_config(sourcetype, inputlevel=0):
+    sconfig = Configuration(options=SOURCE_TYPES[sourcetype].options)
+    sconfig.adapter = sourcetype
+    sconfig.input_config(inputlevel=inputlevel)
+    return sconfig
+
+
 class LoopTask(object):
     """threaded task restarting itself once executed"""
     def __init__(self, interval, func):