VMM/Config: dropped option config.done v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Mon, 01 Feb 2010 18:46:17 +0000
branchv0.6.x
changeset 180 f8279c90e99c
parent 179 3d09c657e9e5
child 181 866a6d679fce
VMM/Config: dropped option config.done
VirtualMailManager/Config.py
VirtualMailManager/VirtualMailManager.py
man/de/man5/vmm.cfg.5.rst
man/man5/vmm.cfg.5.rst
vmm
--- a/VirtualMailManager/Config.py	Sat Jan 30 05:15:21 2010 +0000
+++ b/VirtualMailManager/Config.py	Mon Feb 01 18:46:17 2010 +0000
@@ -320,7 +320,6 @@
                                        self.known_scheme),
                 'transport':       LCO(str, 'dovecot:',  self.get),
             },
-            'config': {'done': LCO(bool_t, False, self.get_boolean)}
         }
 
     def load(self):
@@ -354,8 +353,8 @@
             raise VMMConfigException(errmsg.getvalue(), ERR.CONF_ERROR)
 
     def getsections(self):
-        """Returns a generator object for all configurable sections."""
-        return (s for s in self._cfg.iterkeys() if s != 'config')
+        """Returns an iterator object for all configuration sections."""
+        return self._cfg.iterkeys()
 
     def is_dir(self, path):
         """Checks if ``path`` is a directory.
@@ -409,10 +408,6 @@
 [%(current_value)s]: ')
         failures = 0
 
-        # if config.done == false (default at 1st run),
-        # then set changes true
-        if not self.dget('config.done'):
-            self._modified = True
         w_std(_(u'Using configuration file: %s\n') % self.__cfgFileName)
         for s in sections:
             w_std(_(u'* Configuration section: “%s”') % s )
@@ -440,7 +435,6 @@
 
     def __saveChanges(self):
         """Writes changes to the configuration file."""
-        self.set('config.done', True)
         copy2(self.__cfgFileName, self.__cfgFileName+'.bak')
         self.__cfgFile = open(self.__cfgFileName, 'w')
         self.write(self.__cfgFile)
--- a/VirtualMailManager/VirtualMailManager.py	Sat Jan 30 05:15:21 2010 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Mon Feb 01 18:46:17 2010 +0000
@@ -445,11 +445,10 @@
 
         Keyword arguments:
         section -- the section to configure (default None):
-            'database', 'maildir', 'bin' or 'misc'
         """
         if section is None:
             self.__Cfg.configure(self.__Cfg.getsections())
-        elif section in self.__Cfg.getsections():
+        elif self.__Cfg.has_section(section):
             self.__Cfg.configure([section])
         else:
             raise VMMException(_(u"Invalid section: “%s”") % section,
--- a/man/de/man5/vmm.cfg.5.rst	Sat Jan 30 05:15:21 2010 +0000
+++ b/man/de/man5/vmm.cfg.5.rst	Mon Feb 01 18:46:17 2010 +0000
@@ -7,7 +7,7 @@
 ---------------------------
 
 :Author:         Pascal Volk <neverseen@users.sourceforge.net>
-:Date:           2010-01-30
+:Date:           2010-02-01
 :Version:        vmm-0.6.0
 :Manual group:   vmm Manual
 :Manual section: 5
@@ -63,9 +63,6 @@
   user = ich
   pass = xxxxxxxx
 
-  [config]
-  done = true
-
 
 SUCHREIHENFOLGE
 ---------------
@@ -205,29 +202,6 @@
   postconf = /usr/sbin/postconf
 
 
-CONFIG
-------
-Bei der **config**-Sektion handelt es sich um eine interne
-Steuerungs-Sektion.
-
-.. _config.done:
-
-``done (Vorgabe: false)`` : *Boolean*
-  Diese Option hat den Wert *false*, wenn |vmm(1)|_ zum ersten Mal
-  installiert wurde. Wenn Sie die Datei *vmm.cfg* von Hand editieren, weisen
-  Sie dieser Option abschließend den Wert *true* zu. Wird die Konfiguration
-  über das Kommando |vmm configure|_ angepasst, wird der Wert dieser Option
-  automatisch auf *true* gesetzt.
-
-  Ist der Wert dieser Option  *false*, so startet |vmm(1)|_ beim nächsten
-  Aufruf im interaktiven Konfigurations-Modus.
-
-Beispiel::
-
-  [config]
-  done = true
-
-
 DATABASE
 --------
 Die **database**-Sektion wird verwendet, um die für den Datenbankzugriff
--- a/man/man5/vmm.cfg.5.rst	Sat Jan 30 05:15:21 2010 +0000
+++ b/man/man5/vmm.cfg.5.rst	Mon Feb 01 18:46:17 2010 +0000
@@ -7,7 +7,7 @@
 --------------------------
 
 :Author:         Pascal Volk <neverseen@users.sourceforge.net>
-:Date:           2010-01-30
+:Date:           2010-02-01
 :Version:        vmm-0.6.0
 :Manual group:   vmm Manual
 :Manual section: 5
@@ -59,9 +59,6 @@
   user = me
   pass = xxxxxxxx
 
-  [config]
-  done = true
-
 
 SEARCH ORDER
 -------------
@@ -195,27 +192,6 @@
   postconf = /usr/sbin/postconf
 
 
-CONFIG
-------
-The **config** section is an internal used control section.
-
-.. _config.done:
-
-``done (default: false)`` : *Boolean*
-  This option is set to *false* when |vmm(1)|_ is installed for the first
-  time. When you edit *vmm.cfg*, set this option to *true*. This option is
-  also set to *true* when you configure |vmm(1)|_ with the command |vmm
-  configure|_.
-
-  If this option is set to *false*, |vmm(1)|_ will start in the interactive
-  configurations mode.
-
-Example::
-
-  [config]
-  done = true
-
-
 DATABASE
 --------
 The **database** section is used to specify some options required to
--- a/vmm	Sat Jan 30 05:15:21 2010 +0000
+++ b/vmm	Mon Feb 01 18:46:17 2010 +0000
@@ -181,7 +181,7 @@
     print
 
 def configure():
-    if need_setup or len(argv) < 3:
+    if argc < 3:
         vmm.configure()
     else:
         vmm.configure(argv[2])
@@ -476,8 +476,7 @@
 
     vmm = get_vmm()
     try:
-        need_setup = not vmm.cfgDget('config.done')
-        if   argv[1] in (u'cf', u'configure') or need_setup:
+        if   argv[1] in (u'cf', u'configure'):
             configure()
         elif argv[1] in (u'da', u'domainadd'):
             domain_add()