Skip to content

Commit

Permalink
Merge branch 'master' of github.com:embolalia/willie
Browse files Browse the repository at this point in the history
  • Loading branch information
Elad Alfassa committed Nov 17, 2012
2 parents 639da39 + cededd8 commit 07f0375
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions find.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ def findandreplace(willie, trigger):

if __name__ == '__main__':
print __doc__.strip()

14 changes: 7 additions & 7 deletions github.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
import willie.web as web

def checkConfig(willie):
if not willie.config.has_option('github', 'oath_token') or not willie.config.has_option('github', 'repo'):
if not willie.config.has_option('github', 'oauth_token') or not willie.config.has_option('github', 'repo'):
return False
else:
return [willie.config.github.oath_token, willie.config.github.repo]
return [willie.config.github.oauth_token, willie.config.github.repo]

def configure(config):
"""
| [github] | example | purpose |
| -------- | ------- | ------- |
| Oauth_token | 5868e7af57496cc3ae255868e7af57496cc3ae25 | The OAuth token to connect to your github repo |
| oauth_token | 5868e7af57496cc3ae255868e7af57496cc3ae25 | The OAuth token to connect to your github repo |
| repo | embolalia/willie | The GitHub repo you're working from. |
"""
chunk = ''
if config.option('Configuring github issue reporting and searching module', False):
config.interactive_add('github', 'Oath_token', 'Github API Oauth2 token', '')
config.interactive_add('github', 'oauth_token', 'Github API Oauth2 token', '')
config.interactive_add('github', 'repo', 'Github repository', 'embolalia/willie')
return chunk

Expand All @@ -41,7 +41,7 @@ def issue(willie, trigger):
#Is the Oauth token and repo available?
gitAPI = checkConfig(willie)
if gitAPI == False:
return willie.say('Git module not configured, make sure git_Oath_token and git_repo are defined')
return willie.say('Git module not configured, make sure github.oauth_token and github.repo are defined')

#parse input
now = ' '.join(str(datetime.utcnow()).split(' ')).split('.')[0]+' UTC'
Expand All @@ -55,7 +55,7 @@ def issue(willie, trigger):

data = json.loads(raw)
willie.say('Issue #%s posted. %s' % (data['number'], data['html_url']))
willie.debug('','Issue #%s created in %s' % (data['number'],trigger.sender),'warning')
willie.debug('GitHub','Issue #%s created in %s' % (data['number'],trigger.sender),'warning')
issue.commands = ['makeissue','makebug']
issue.priority = 'medium'

Expand All @@ -67,7 +67,7 @@ def findIssue(willie, trigger):
#Is the Oauth token and repo available?
gitAPI = checkConfig(willie)
if gitAPI == False:
return willie.say('Git module not configured, make sure git_Oath_token and git_repo are defined')
return willie.say('Git module not configured, make sure github.oauth_token and github.repo are defined')
firstParam = trigger.group(2).split(' ')[0]
if firstParam.isdigit():
URL = 'https://api.github.com/repos/%s/issues/%s' % (gitAPI[1], trigger.group(2))
Expand Down
1 change: 1 addition & 0 deletions search.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
search.py - Willie Web Search Module
Copyright 2008-9, Sean B. Palmer, inamidst.com
Copyright 2012, Edward Powell, embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net
Expand Down

0 comments on commit 07f0375

Please sign in to comment.