Remove the checking for the default configuration values
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)
Since some options are set as defaults in stgit/config.py, there is no need
to check for their presence with config.has_option().

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/mail.py
stgit/commands/refresh.py

index 2fb88bc..633e0d2 100644 (file)
@@ -344,8 +344,6 @@ def func(parser, options, args):
     """Send the patches by e-mail using the patchmail.tmpl file as
     a template
     """
-    if not config.has_option('stgit', 'smtpserver'):
-        raise CmdException, 'smtpserver not defined'
     smtpserver = config.get('stgit', 'smtpserver')
 
     smtpuser = None
index 20b7546..c5f390f 100644 (file)
@@ -66,10 +66,7 @@ options = [make_option('-f', '--force',
 
 
 def func(parser, options, args):
-    if config.has_option('stgit', 'autoresolved'):
-        autoresolved = config.get('stgit', 'autoresolved')
-    else:
-        autoresolved = 'no'
+    autoresolved = config.get('stgit', 'autoresolved')
 
     if autoresolved != 'yes':
         check_conflicts()