Don't override "id" and "type" builtins
This commit is contained in:
parent
747529845e
commit
5ef524d3b1
2 changed files with 13 additions and 13 deletions
|
@ -115,14 +115,14 @@ class Plugin(BasePlugin):
|
||||||
|
|
||||||
def command_done(self, arg="0"):
|
def command_done(self, arg="0"):
|
||||||
try:
|
try:
|
||||||
id = int(arg)
|
id_ = int(arg)
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
if not id in self.tasks:
|
if not id_ in self.tasks:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.api.information('Task %s: %s [DONE]' % (id, self.tasks[id][1]), 'Info')
|
self.api.information('Task %s: %s [DONE]' % (id_, self.tasks[id_][1]), 'Info')
|
||||||
del self.tasks[id]
|
del self.tasks[id_]
|
||||||
|
|
||||||
def command_tasks(self, arg, nocommand=None):
|
def command_tasks(self, arg, nocommand=None):
|
||||||
if nocommand:
|
if nocommand:
|
||||||
|
@ -135,13 +135,13 @@ class Plugin(BasePlugin):
|
||||||
if s:
|
if s:
|
||||||
self.api.information(s, 'Info')
|
self.api.information(s, 'Info')
|
||||||
|
|
||||||
def remind(self, id=0):
|
def remind(self, id_=0):
|
||||||
if not id in self.tasks:
|
if not id_ in self.tasks:
|
||||||
return
|
return
|
||||||
self.api.information('Task %s: %s' % (id, self.tasks[id][1]), 'Info')
|
self.api.information('Task %s: %s' % (id_, self.tasks[id_][1]), 'Info')
|
||||||
if self.config.get('beep', '') == 'true':
|
if self.config.get('beep', '') == 'true':
|
||||||
curses.beep()
|
curses.beep()
|
||||||
timed_event = timed_events.DelayedEvent(self.tasks[id][0], self.remind, id)
|
timed_event = timed_events.DelayedEvent(self.tasks[id_][0], self.remind, id_)
|
||||||
self.api.add_timed_event(timed_event)
|
self.api.add_timed_event(timed_event)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
|
|
|
@ -148,13 +148,13 @@ class CommandCore:
|
||||||
if args is None:
|
if args is None:
|
||||||
return self.help('presence')
|
return self.help('presence')
|
||||||
|
|
||||||
jid, type, status = args[0], args[1], args[2]
|
jid, ptype, status = args[0], args[1], args[2]
|
||||||
if jid == '.' and isinstance(self.core.current_tab(), tabs.ChatTab):
|
if jid == '.' and isinstance(self.core.current_tab(), tabs.ChatTab):
|
||||||
jid = self.core.current_tab().name
|
jid = self.core.current_tab().name
|
||||||
if type == 'available':
|
if ptype == 'available':
|
||||||
type = None
|
ptype = None
|
||||||
try:
|
try:
|
||||||
pres = self.core.xmpp.make_presence(pto=jid, ptype=type, pstatus=status)
|
pres = self.core.xmpp.make_presence(pto=jid, ptype=ptype, pstatus=status)
|
||||||
self.core.events.trigger('send_normal_presence', pres)
|
self.core.events.trigger('send_normal_presence', pres)
|
||||||
pres.send()
|
pres.send()
|
||||||
except:
|
except:
|
||||||
|
@ -163,7 +163,7 @@ class CommandCore:
|
||||||
return
|
return
|
||||||
tab = self.core.get_tab_by_name(jid)
|
tab = self.core.get_tab_by_name(jid)
|
||||||
if tab:
|
if tab:
|
||||||
if type in ('xa', 'away'):
|
if ptype in ('xa', 'away'):
|
||||||
tab.directed_presence = False
|
tab.directed_presence = False
|
||||||
chatstate = 'inactive'
|
chatstate = 'inactive'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue