projects
/
zzz-dywypi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c23fdf
)
Fixed NetHack plugin crashing on first load.
author
Eevee
<git@veekun.com>
Wed, 3 Feb 2010 05:24:21 +0000
(21:24 -0800)
committer
Eevee
<git@veekun.com>
Wed, 3 Feb 2010 05:24:21 +0000
(21:24 -0800)
plugins/NetHack/plugin.py
patch
|
blob
|
history
diff --git
a/plugins/NetHack/plugin.py
b/plugins/NetHack/plugin.py
index
6560f80
..
05d78db
100644
(file)
--- a/
plugins/NetHack/plugin.py
+++ b/
plugins/NetHack/plugin.py
@@
-119,7
+119,7
@@
def parse_livelog(line):
data[key] = val
return data
data[key] = val
return data
-
+
def livelog_announcement(livelog):
# achievement gained
if 'achieve_diff' in livelog:
def livelog_announcement(livelog):
# achievement gained
if 'achieve_diff' in livelog:
@@
-181,8
+181,12
@@
class NetHack(callbacks.Plugin):
self.xlog.seek(0, os.SEEK_END)
self.livelog.seek(0, os.SEEK_END)
self.xlog.seek(0, os.SEEK_END)
self.livelog.seek(0, os.SEEK_END)
- # Remove the event first, in case this is a reload
- schedule.removePeriodicEvent('nethack-log-ping')
+ # Remove the event first, in case this is a reload. This will fail if
+ # this is the first load, so throw it in a try
+ try:
+ schedule.removePeriodicEvent('nethack-log-ping')
+ except:
+ pass
def callback():
self._checkLogs(irc)
def callback():
self._checkLogs(irc)