changeset 18254a32fdd7 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=18254a32fdd7
description: remove useless print
diffstat:
src/common/connection.py | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diffs (11 lines):
diff -r be585cee6a58 -r 18254a32fdd7 src/common/connection.py
--- a/src/common/connection.py Fri Mar 19 08:20:58 2010 +0100
+++ b/src/common/connection.py Fri Mar 19 08:21:57 2010 +0100
@@ -514,7 +514,6 @@
groupchat_jid is used when we want to send a request to a real jid and
act as if the answer comes from the groupchat_jid
"""
- print 'request_last_status_time', self.connection
if not self.connection:
return
to_whom_jid = jid
changeset adfeda7de463 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=adfeda7de463
description: Contracted @documentation to @doc
diffstat:
src/command_system/framework.py | 2 +-
src/command_system/implementation/custom.py | 4 +-
src/command_system/implementation/standard.py | 54 +++++++++++++-------------
3 files changed, 30 insertions(+), 30 deletions(-)
diffs (254 lines):
diff -r 439ccdbe2561 -r adfeda7de463 src/command_system/framework.py
--- a/src/command_system/framework.py Thu Mar 18 14:40:00 2010 +0100
+++ b/src/command_system/framework.py Fri Mar 19 03:22:17 2010 +0200
@@ -330,7 +330,7 @@
return decorator
-def documentation(text):
+def doc(text):
"""
This decorator is used to bind a documentation (a help) to a
command.
diff -r 439ccdbe2561 -r adfeda7de463 src/command_system/implementation/custom.py
--- a/src/command_system/implementation/custom.py Thu Mar 18 14:40:00 2010 +0100
+++ b/src/command_system/implementation/custom.py Fri Mar 19 03:22:17 2010 +0200
@@ -21,7 +21,7 @@
be executed and commands defined here will not be detected.
"""
-from ..framework import CommandContainer, command, documentation
+from ..framework import CommandContainer, command, doc
from hosts import ChatCommands, PrivateChatCommands, GroupChatCommands
class CustomCommonCommands(CommandContainer):
@@ -58,7 +58,7 @@
HOSTS = (ChatCommands,)
- @documentation(_("The same as using a doc-string, except it supports translation"))
+ @doc(_("The same as using a doc-string, except it supports translation"))
@command
def sing(self):
return "Are you phreaking kidding me? Buy yourself a damn stereo..."
diff -r 439ccdbe2561 -r adfeda7de463 src/command_system/implementation/standard.py
--- a/src/command_system/implementation/standard.py Thu Mar 18 14:40:00 2010 +0100
+++ b/src/command_system/implementation/standard.py Fri Mar 19 03:22:17 2010 +0200
@@ -27,7 +27,7 @@
from common.logger import Constants
from ..errors import CommandError
-from ..framework import CommandContainer, command, documentation
+from ..framework import CommandContainer, command, doc
from ..mapping import generate_usage
from hosts import ChatCommands, PrivateChatCommands, GroupChatCommands
@@ -45,18 +45,18 @@
HOSTS = (ChatCommands, PrivateChatCommands, GroupChatCommands)
@command
- @documentation(_("Clear the text window"))
+ @doc(_("Clear the text window"))
def clear(self):
self.conv_textview.clear()
@command
- @documentation(_("Hide the chat buttons"))
+ @doc(_("Hide the chat buttons"))
def compact(self):
new_status = not self.hide_chat_buttons
self.chat_buttons_set_visible(new_status)
@command(overlap=True)
- @documentation(_("Show help on a given command or a list of available commands if -(-a)ll is given"))
+ @doc(_("Show help on a given command or a list of available commands if -(-a)ll is given"))
def help(self, command=None, all=False):
if command:
command = self.get_command(command)
@@ -83,17 +83,17 @@
self.echo(help(self, 'help'))
@command(raw=True)
- @documentation(_("Send a message to the contact"))
+ @doc(_("Send a message to the contact"))
def say(self, message):
self.send(message)
@command(raw=True)
- @documentation(_("Send action (in the third person) to the current chat"))
+ @doc(_("Send action (in the third person) to the current chat"))
def me(self, action):
self.send("/me %s" % action)
@command('lastlog', overlap=True)
- @documentation(_("Show logged messages which mention given text"))
+ @doc(_("Show logged messages which mention given text"))
def grep(self, text, limit=None):
results = gajim.logger.get_search_results_for_query(self.contact.jid,
text, self.account)
@@ -129,7 +129,7 @@
self.echo(formatted)
@command(raw=True, empty=True)
- @documentation(_("""
+ @doc(_("""
Set current the status
Status can be given as one of the following values: online, away,
@@ -142,7 +142,7 @@
connection.change_status(status, message)
@command(raw=True, empty=True)
- @documentation(_("Set the current status to away"))
+ @doc(_("Set the current status to away"))
def away(self, message):
if not message:
message = _("Away")
@@ -150,7 +150,7 @@
connection.change_status('away', message)
@command('back', raw=True, empty=True)
- @documentation(_("Set the current status to online"))
+ @doc(_("Set the current status to online"))
def online(self, message):
if not message:
message = _("Available")
@@ -166,19 +166,19 @@
HOSTS = (ChatCommands, PrivateChatCommands)
@command
- @documentation(_("Toggle the GPG encryption"))
+ @doc(_("Toggle the GPG encryption"))
def gpg(self):
self._toggle_gpg()
@command
- @documentation(_("Send a ping to the contact"))
+ @doc(_("Send a ping to the contact"))
def ping(self):
if self.account == gajim.ZEROCONF_ACC_NAME:
raise CommandError(_('Command is not supported for zeroconf accounts'))
gajim.connections[self.account].sendPing(self.contact)
@command
- @documentation(_("Send DTMF events through an open audio session"))
+ @doc(_("Send DTMF events through an open audio session"))
def dtmf(self, events):
if not self.audio_sid:
raise CommandError(_("There is no open audio session with this contact"))
@@ -193,7 +193,7 @@
raise CommandError(_("No valid DTMF event specified"))
@command
- @documentation(_("Toggle audio session"))
+ @doc(_("Toggle audio session"))
def audio(self):
if self.audio_state == self.JINGLE_STATE_NOT_AVAILABLE:
raise CommandError(_("Video sessions are not available"))
@@ -204,7 +204,7 @@
self._audio_button.set_active(not state)
@command
- @documentation(_("Toggle video session"))
+ @doc(_("Toggle video session"))
def video(self):
if self.video_state == self.JINGLE_STATE_NOT_AVAILABLE:
raise CommandError(_("Video sessions are not available"))
@@ -239,7 +239,7 @@
HOSTS = (GroupChatCommands,)
@command(raw=True)
- @documentation(_("Change your nickname in a group chat"))
+ @doc(_("Change your nickname in a group chat"))
def nick(self, new_nick):
try:
new_nick = helpers.parse_resource(new_nick)
@@ -249,7 +249,7 @@
self.new_nick = new_nick
@command('query', raw=True)
- @documentation(_("Open a private chat window with a specified occupant"))
+ @doc(_("Open a private chat window with a specified occupant"))
def chat(self, nick):
nicks = gajim.contacts.get_nick_list(self.account, self.room_jid)
if nick in nicks:
@@ -258,7 +258,7 @@
raise CommandError(_("Nickname not found"))
@command('msg', raw=True)
- @documentation(_("Open a private chat window with a specified occupant and send him a message"))
+ @doc(_("Open a private chat window with a specified occupant and send him a message"))
def message(self, nick, a_message):
nicks = gajim.contacts.get_nick_list(self.account, self.room_jid)
if nick in nicks:
@@ -267,7 +267,7 @@
raise CommandError(_("Nickname not found"))
@command(raw=True, empty=True)
- @documentation(_("Display or change a group chat topic"))
+ @doc(_("Display or change a group chat topic"))
def topic(self, new_topic):
if new_topic:
self.connection.send_gc_subject(self.room_jid, new_topic)
@@ -275,13 +275,13 @@
return self.subject
@command(raw=True, empty=True)
- @documentation(_("Invite a user to a room for a reason"))
+ @doc(_("Invite a user to a room for a reason"))
def invite(self, jid, reason):
self.connection.send_invite(self.room_jid, jid, reason)
return _("Invited %s to %s") % (jid, self.room_jid)
@command(raw=True, empty=True)
- @documentation(_("Join a group chat given by a jid, optionally using given nickname"))
+ @doc(_("Join a group chat given by a jid, optionally using given nickname"))
def join(self, jid, nick):
if not nick:
nick = self.nick
@@ -298,12 +298,12 @@
pass
@command('part', 'close', raw=True, empty=True)
- @documentation(_("Leave the groupchat, optionally giving a reason, and close tab or window"))
+ @doc(_("Leave the groupchat, optionally giving a reason, and close tab or window"))
def leave(self, reason):
self.parent_win.remove_tab(self, self.parent_win.CLOSE_COMMAND, reason)
@command(raw=True, empty=True)
- @documentation(_("""
+ @doc(_("""
Ban user by a nick or a jid from a groupchat
If given nickname is not found it will be treated as a jid.
@@ -315,14 +315,14 @@
self.connection.gc_set_affiliation(self.room_jid, who, 'outcast', reason or str())
@command(raw=True, empty=True)
- @documentation(_("Kick user by a nick from a groupchat"))
+ @doc(_("Kick user by a nick from a groupchat"))
def kick(self, who, reason):
if not who in gajim.contacts.get_nick_list(self.account, self.room_jid):
raise CommandError(_("Nickname not found"))
self.connection.gc_set_role(self.room_jid, who, 'none', reason or str())
@command
- @documentation(_("Display names of all group chat occupants"))
+ @doc(_("Display names of all group chat occupants"))
def names(self, verbose=False):
get_contact = lambda nick: gajim.contacts.get_gc_contact(self.account, self.room_jid, nick)
nicks = gajim.contacts.get_nick_list(self.account, self.room_jid)
@@ -343,11 +343,11 @@
return ', '.join(nicks)
@command('ignore', raw=True)
- @documentation(_("Forbid an occupant to send you public or private messages"))
+ @doc(_("Forbid an occupant to send you public or private messages"))
def block(self, who):
self.on_block(None, who)
@command('unignore', raw=True)
- @documentation(_("Allow an occupant to send you public or private messages"))
+ @doc(_("Allow an occupant to send you public or private messages"))
def unblock(self, who):
self.on_unblock(None, who)
changeset 1e64734c26ef in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=1e64734c26ef
description: Check that there is an argument to gajim-remove handle_uri function. Fixes #5660
diffstat:
src/config.py | 32 ++++++++++++++++----------------
src/gajim-remote.py | 2 ++
2 files changed, 18 insertions(+), 16 deletions(-)
diffs (55 lines):
diff -r 15f6a54fcd73 -r 1e64734c26ef src/config.py
--- a/src/config.py Tue Mar 16 07:09:44 2010 +0100
+++ b/src/config.py Thu Mar 18 13:31:12 2010 +0100
@@ -2764,23 +2764,23 @@
gajim.config.del_per('accounts', self.account)
gajim.interface.save_config()
del gajim.interface.instances[self.account]
- if self.account in gajim.nicks:
+ if self.account in gajim.nicks:
del gajim.interface.minimized_controls[self.account]
- del gajim.nicks[self.account]
- del gajim.block_signed_in_notifications[self.account]
- del gajim.groups[self.account]
- gajim.contacts.remove_account(self.account)
- del gajim.gc_connected[self.account]
- del gajim.automatic_rooms[self.account]
- del gajim.to_be_removed[self.account]
- del gajim.newly_added[self.account]
- del gajim.sleeper_state[self.account]
- del gajim.encrypted_chats[self.account]
- del gajim.last_message_time[self.account]
- del gajim.status_before_autoaway[self.account]
- del gajim.transport_avatar[self.account]
- del gajim.gajim_optional_features[self.account]
- del gajim.caps_hash[self.account]
+ del gajim.nicks[self.account]
+ del gajim.block_signed_in_notifications[self.account]
+ del gajim.groups[self.account]
+ gajim.contacts.remove_account(self.account)
+ del gajim.gc_connected[self.account]
+ del gajim.automatic_rooms[self.account]
+ del gajim.to_be_removed[self.account]
+ del gajim.newly_added[self.account]
+ del gajim.sleeper_state[self.account]
+ del gajim.encrypted_chats[self.account]
+ del gajim.last_message_time[self.account]
+ del gajim.status_before_autoaway[self.account]
+ del gajim.transport_avatar[self.account]
+ del gajim.gajim_optional_features[self.account]
+ del gajim.caps_hash[self.account]
if len(gajim.connections) >= 2: # Do not merge accounts if only one exists
gajim.interface.roster.regroup = gajim.config.get('mergeaccounts')
else:
diff -r 15f6a54fcd73 -r 1e64734c26ef src/gajim-remote.py
--- a/src/gajim-remote.py Tue Mar 16 07:09:44 2010 +0100
+++ b/src/gajim-remote.py Thu Mar 18 13:31:12 2010 +0100
@@ -513,6 +513,8 @@
self.arguments += ['']*(len(args)-i)
def handle_uri(self):
+ if len(sys.argv) < 3:
+ send_error(_('No uri given'))
if not sys.argv[2].startswith('xmpp:'):
send_error(_('Wrong uri'))
sys.argv[2] = sys.argv[2][5:]
changeset aea349158914 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=aea349158914
description: don't traceback when remove a disabled account. Fixes #5647
diffstat:
src/config.py | 61 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 37 insertions(+), 24 deletions(-)
diffs (112 lines):
diff -r 5fecaef990ba -r aea349158914 src/config.py
--- a/src/config.py Tue Mar 09 21:48:57 2010 +0100
+++ b/src/config.py Wed Mar 10 13:51:55 2010 +0100
@@ -1740,9 +1740,9 @@
return
win_opened = False
- if gajim.interface.msg_win_mgr.get_controls(acct = account):
+ if gajim.interface.msg_win_mgr.get_controls(acct=account):
win_opened = True
- else:
+ elif account in gajim.interface.instances:
for key in gajim.interface.instances[account]:
if gajim.interface.instances[account][key] and key != \
'remove_account':
@@ -1750,10 +1750,13 @@
break
# Detect if we have opened windows for this account
def remove(account):
- if 'remove_account' in gajim.interface.instances[account]:
+ if account in gajim.interface.instances and \
+ 'remove_account' in gajim.interface.instances[account]:
gajim.interface.instances[account]['remove_account'].window.\
present()
else:
+ if not account in gajim.interface.instances:
+ gajim.interface.instances[account] = {}
gajim.interface.instances[account]['remove_account'] = \
RemoveAccountWindow(account)
if win_opened:
@@ -2706,12 +2709,19 @@
def on_remove_button_clicked(self, widget):
def remove():
- if gajim.connections[self.account].connected and \
+ if self.account in gajim.connections and \
+ gajim.connections[self.account].connected and \
not self.remove_and_unregister_radiobutton.get_active():
# change status to offline only if we will not remove this JID from
# server
gajim.connections[self.account].change_status('offline', 'offline')
if self.remove_and_unregister_radiobutton.get_active():
+ if not self.account in gajim.connections:
+ dialogs.ErrorDialog(
+ _('Account is disabled'),
+ _('To unregister from a server, account must be '
+ 'enabled.'))
+ return
if not gajim.connections[self.account].password:
def on_ok(passphrase, checked):
if passphrase == -1:
@@ -2731,7 +2741,8 @@
else:
self._on_remove_success(True)
- if gajim.connections[self.account].connected:
+ if self.account in gajim.connections and \
+ gajim.connections[self.account].connected:
dialogs.ConfirmationDialog(
_('Account "%s" is connected to the server') % self.account,
_('If you remove it, the connection will be lost.'),
@@ -2745,29 +2756,31 @@
if not res:
return
# Close all opened windows
- gajim.interface.roster.close_all(self.account, force = True)
- gajim.connections[self.account].disconnect(on_purpose = True)
- del gajim.connections[self.account]
+ gajim.interface.roster.close_all(self.account, force=True)
+ if self.account in gajim.connections:
+ gajim.connections[self.account].disconnect(on_purpose=True)
+ del gajim.connections[self.account]
gajim.logger.remove_roster(gajim.get_jid_from_account(self.account))
gajim.config.del_per('accounts', self.account)
gajim.interface.save_config()
del gajim.interface.instances[self.account]
- del gajim.interface.minimized_controls[self.account]
- del gajim.nicks[self.account]
- del gajim.block_signed_in_notifications[self.account]
- del gajim.groups[self.account]
- gajim.contacts.remove_account(self.account)
- del gajim.gc_connected[self.account]
- del gajim.automatic_rooms[self.account]
- del gajim.to_be_removed[self.account]
- del gajim.newly_added[self.account]
- del gajim.sleeper_state[self.account]
- del gajim.encrypted_chats[self.account]
- del gajim.last_message_time[self.account]
- del gajim.status_before_autoaway[self.account]
- del gajim.transport_avatar[self.account]
- del gajim.gajim_optional_features[self.account]
- del gajim.caps_hash[self.account]
+ if self.account in gajim.nicks:
+ del gajim.interface.minimized_controls[self.account]
+ del gajim.nicks[self.account]
+ del gajim.block_signed_in_notifications[self.account]
+ del gajim.groups[self.account]
+ gajim.contacts.remove_account(self.account)
+ del gajim.gc_connected[self.account]
+ del gajim.automatic_rooms[self.account]
+ del gajim.to_be_removed[self.account]
+ del gajim.newly_added[self.account]
+ del gajim.sleeper_state[self.account]
+ del gajim.encrypted_chats[self.account]
+ del gajim.last_message_time[self.account]
+ del gajim.status_before_autoaway[self.account]
+ del gajim.transport_avatar[self.account]
+ del gajim.gajim_optional_features[self.account]
+ del gajim.caps_hash[self.account]
if len(gajim.connections) >= 2: # Do not merge accounts if only one exists
gajim.interface.roster.regroup = gajim.config.get('mergeaccounts')
else: