Changeset 1243

Show
Ignore:
Timestamp:
08/04/07 13:39:51 (6 years ago)
Author:
boltrix
Message:

Approach on solving Bug #1750194. While running on python versions lower than 2.5 webbrowser.open won't be called with the new=2 parameter.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/umitCore/UmitConfigParser.py

    r1192 r1243  
    2020# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
    2121 
    22 from ConfigParser import ConfigParser, DEFAULTSECT 
     22from os.path import exists 
     23from ConfigParser import ConfigParser, DEFAULTSECT, NoOptionError, NoSectionError 
    2324 
    2425class UmitConfigParser(ConfigParser): 
     
    8081                             (key, str(value).replace('\n', '\n\t'))) 
    8182            fp.write("\n") 
     83 
     84def test_umit_conf_content(self, parser): 
     85    # Paths section 
     86    assert exists(get_or_false(parser, "paths", "config_file") or "") 
     87 
     88def get_or_false(self, parser, section, option): 
     89    try: 
     90        return parser.get(section, option) 
     91    except NoOptionError: 
     92        return False 
     93    except NoSectionError: 
     94        return False