Skip to content
Browse files

Update creepy/creepymap.py

  • Loading branch information...
1 parent 25c95bd commit 04bf3b853ab59e6d01662a25b5e3b7a65c5311aa @jkakavas jkakavas committed Apr 18, 2012
Showing with 19 additions and 13 deletions.
  1. +19 −13 creepy/creepymap.py
View
32 creepy/creepymap.py
@@ -108,19 +108,25 @@ def __init__(self):
try:
config_file = os.path.join(self.CONF_DIR, 'creepy.conf')
temp_config = ConfigObj(infile=config_file)
- count = temp_config['tweepy']['count']
- handle_links = temp_config['twitter']['handle_links']
- except:
- temp_config['tweepy']['count'] = 100
- temp_config['twitter']['handle_links'] = "yes"
- temp_config.write()
- try:
- config_file = os.path.join(self.CONF_DIR, 'creepy.conf')
- temp_config = ConfigObj(infile=config_file)
- cons_string = temp_config['twitter_auth']['cons_string']
- except:
- temp_config['twitter_auth']['cons_string'] = 'QjZEVGxuVEJLUk9MSTZiUWxHdXJTdyxzWDFUV0ZIVDd4c1VYcE5WUFpaZ3Fhc2FDNE9GamRGcEk0czVLSDhHSQ=='
- temp_config.write()
+ try:
+ count = temp_config['tweepy']['count']
+ except:
+ temp_config['tweepy'] = {}
+ temp_config['tweepy']['count'] = 100
+ temp_config.write()
+ try:
+ handle_links = temp_config['twitter']['handle_links']
+ except:
+ temp_config['twitter']['handle_links'] = "yes"
+ temp_config.write()
+ try:
+ cons_string = temp_config['twitter_auth']['cons_string']
+ except:
+ temp_config['twitter_auth']['cons_string'] = 'QjZEVGxuVEJLUk9MSTZiUWxHdXJTdyxzWDFUV0ZIVDd4c1VYcE5WUFpaZ3Fhc2FDNE9GamRGcEk0czVLSDhHSQ=='
+ temp_config.write()
+ except Exception, err:
+ text = 'Error parsing configuration file : %s' % err
+ self.create_dialog('Error', text)
#Try to load the options file
try:
config_file = os.path.join(self.CONF_DIR, 'creepy.conf')

0 comments on commit 04bf3b8

Please sign in to comment.
Something went wrong with that request. Please try again.