changeset 475d5057e4e4 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=475d5057e4e4 description: harmonize indentation. Fixes #5518
diffstat:
src/common/gajim.py | 8 ++++---- src/common/xmpp/protocol.py | 12 ++++++------ src/common/zeroconf/zeroconf_avahi.py | 4 ++-- src/common/zeroconf/zeroconf_bonjour.py | 22 +++++++++++----------- src/groupchat_control.py | 8 ++++---- src/history_manager.py | 32 ++++++++++++++++---------------- src/roster_window.py | 4 ++-- 7 files changed, 45 insertions(+), 45 deletions(-)
diffs (246 lines):
diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/gajim.py --- a/src/common/gajim.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/common/gajim.py Mon Dec 28 23:04:23 2009 +0100 @@ -82,7 +82,7 @@ MY_ICONSETS_PATH = gajimpaths['MY_ICONSETS'] MY_MOOD_ICONSETS_PATH = gajimpaths['MY_MOOD_ICONSETS'] MY_ACTIVITY_ICONSETS_PATH = gajimpaths['MY_ACTIVITY_ICONSETS'] -MY_CACERTS = gajimpaths['MY_CACERTS'] +MY_CACERTS = gajimpaths['MY_CACERTS'] TMP = gajimpaths['TMP'] DATA_DIR = gajimpaths['DATA'] ICONS_DIR = gajimpaths['ICONS'] @@ -223,9 +223,9 @@ return jid[pos:]
def get_resource_from_jid(jid): - tokens = jid.split('/', 1) - if len(tokens) > 1: - return tokens[1] + tokens = jid.split('/', 1) + if len(tokens) > 1: + return tokens[1]
def get_name_and_server_from_jid(jid): name = get_nick_from_jid(jid) diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/xmpp/protocol.py --- a/src/common/xmpp/protocol.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/common/xmpp/protocol.py Mon Dec 28 23:04:23 2009 +0100 @@ -523,12 +523,12 @@ return time.strftime('%Y%m%dT%H:%M:%S', time.gmtime())
def getTimestamp2(self): - """ - Return the timestamp in the 'yyyymmddThhmmss' format - """ - if self.timestamp: - return self.timestamp - return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()) + """ + Return the timestamp in the 'yyyymmddThhmmss' format + """ + if self.timestamp: + return self.timestamp + return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
def getID(self): """ diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/zeroconf/zeroconf_avahi.py --- a/src/common/zeroconf/zeroconf_avahi.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/common/zeroconf/zeroconf_avahi.py Mon Dec 28 23:04:23 2009 +0100 @@ -77,7 +77,7 @@ log.debug('Found service %s in domain %s on %i.%i.' % (name, domain, interface, protocol)) if not self.connected: - return + return
# synchronous resolving self.server.ResolveService( int(interface), int(protocol), name, stype, @@ -90,7 +90,7 @@ log.debug('Service %s in domain %s on %i.%i disappeared.' % (name, domain, interface, protocol)) if not self.connected: - return + return if name != self.name: for key in self.contacts.keys(): if self.contacts[key][C_BARE_NAME] == name: diff -r 1d96df4d8e56 -r 475d5057e4e4 src/common/zeroconf/zeroconf_bonjour.py --- a/src/common/zeroconf/zeroconf_bonjour.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/common/zeroconf/zeroconf_bonjour.py Mon Dec 28 23:04:23 2009 +0100 @@ -10,11 +10,11 @@ ## ## Gajim is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with Gajim. If not, see http://www.gnu.org/licenses/. +## along with Gajim. If not, see http://www.gnu.org/licenses/. ##
from common import gajim @@ -28,14 +28,14 @@ pass
-resolve_timeout = 1 +resolve_timeout = 1
class Zeroconf: def __init__(self, new_serviceCB, remove_serviceCB, name_conflictCB, disconnected_CB, error_CB, name, host, port): - self.domain = None # specific domain to browse + self.domain = None # specific domain to browse self.stype = '_presence._tcp' - self.port = port # listening port that gets announced + self.port = port # listening port that gets announced self.username = name self.host = host self.txt = pybonjour.TXTRecord() # service data @@ -48,7 +48,7 @@ self.disconnected_CB = disconnected_CB self.error_CB = error_CB
- self.contacts = {} # all current local contacts with data + self.contacts = {} # all current local contacts with data self.connected = False self.announced = False self.invalid_self_contact = {} @@ -58,7 +58,7 @@ def browse_callback(self, sdRef, flags, interfaceIndex, errorCode, serviceName, regtype, replyDomain): gajim.log.debug('Found service %s in domain %s on %i(type: %s).' % (serviceName, replyDomain, interfaceIndex, regtype)) if not self.connected: - return + return if errorCode != pybonjour.kDNSServiceErr_NoError: return if not (flags & pybonjour.kDNSServiceFlagsAdd): @@ -83,7 +83,7 @@ def remove_service_callback(self, name): gajim.log.debug('Service %s disappeared.' % name) if not self.connected: - return + return if name != self.name: for key in self.contacts.keys(): if self.contacts[key][C_BARE_NAME] == name: @@ -103,7 +103,7 @@ def service_resolved_callback(self, sdRef, flags, interfaceIndex, errorCode, fullname, hosttarget, port, txtRecord):
- # TODO: do proper decoding... + # TODO: do proper decoding... escaping= { r'.': '.', r'\032': ' ', @@ -211,7 +211,7 @@ txt['version'] = 1 txt['txtvers'] = 1
- # replace gajim's show messages with compatible ones + # replace gajim's show messages with compatible ones if 'status' in self.txt: txt['status'] = self.replace_show(self.txt['status']) else: @@ -221,7 +221,7 @@
try: sdRef = pybonjour.DNSServiceRegister(name = self.name, - regtype = self.stype, port = self.port, txtRecord = self.txt, + regtype = self.stype, port = self.port, txtRecord = self.txt, callBack = self.service_added_callback) self.service_sdRef = sdRef except pybonjour.BonjourError, e: diff -r 1d96df4d8e56 -r 475d5057e4e4 src/groupchat_control.py --- a/src/groupchat_control.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/groupchat_control.py Mon Dec 28 23:04:23 2009 +0100 @@ -126,8 +126,8 @@ class PrivateChatControl(ChatControl): TYPE_ID = message_control.TYPE_PM
- # Set a command host to bound to. Every command given through a private chat - # will be processed with this command host. + # Set a command host to bound to. Every command given through a private chat + # will be processed with this command host. COMMAND_HOST = PrivateChatCommands
def __init__(self, parent_win, gc_contact, contact, account, session): @@ -193,8 +193,8 @@ class GroupchatControl(ChatControlBase): TYPE_ID = message_control.TYPE_GC
- # Set a command host to bound to. Every command given through a group chat - # will be processed with this command host. + # Set a command host to bound to. Every command given through a group chat + # will be processed with this command host. COMMAND_HOST = GroupChatCommands
def __init__(self, parent_win, contact, acct, is_continued=False): diff -r 1d96df4d8e56 -r 475d5057e4e4 src/history_manager.py --- a/src/history_manager.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/history_manager.py Mon Dec 28 23:04:23 2009 +0100 @@ -57,23 +57,23 @@ from common import i18n
def parseOpts(): - config_path = None + config_path = None
- try: - shortargs = 'hc:' - longargs = 'help config_path=' - opts = getopt.getopt(sys.argv[1:], shortargs, longargs.split())[0] - except getopt.error, msg: - print str(msg) - print 'for help use --help' - sys.exit(2) - for o, a in opts: - if o in ('-h', '--help'): - print 'history_manager [--help] [--config-path]' - sys.exit() - elif o in ('-c', '--config-path'): - config_path = a - return config_path + try: + shortargs = 'hc:' + longargs = 'help config_path=' + opts = getopt.getopt(sys.argv[1:], shortargs, longargs.split())[0] + except getopt.error, msg: + print str(msg) + print 'for help use --help' + sys.exit(2) + for o, a in opts: + if o in ('-h', '--help'): + print 'history_manager [--help] [--config-path]' + sys.exit() + elif o in ('-c', '--config-path'): + config_path = a + return config_path
config_path = parseOpts() del parseOpts diff -r 1d96df4d8e56 -r 475d5057e4e4 src/roster_window.py --- a/src/roster_window.py Mon Dec 28 22:41:05 2009 +0100 +++ b/src/roster_window.py Mon Dec 28 23:04:23 2009 +0100 @@ -1778,7 +1778,7 @@ """ Remove contacts on last events removed
- Only performed if removal was requested before but the contact still had + Only performed if removal was requested before but the contact still had pending events """ contact_list = ((event.jid.split('/')[0], event.account) for event in \ @@ -5748,7 +5748,7 @@ self.popups_notification_height = 0 self.popup_notification_windows = []
- # Remove contact from roster when last event opened + # Remove contact from roster when last event opened # { (contact, account): { backend: boolean } self.contacts_to_be_removed = {} gajim.events.event_removed_subscribe(self.on_event_removed)