[thorstenp] fix reimported modules
This commit is contained in:
parent
22f2cb37a7
commit
088378a9b7
4 changed files with 11 additions and 19 deletions
|
@ -36,7 +36,6 @@ import subprocess
|
||||||
import urllib
|
import urllib
|
||||||
import errno
|
import errno
|
||||||
import select
|
import select
|
||||||
import sha
|
|
||||||
import base64
|
import base64
|
||||||
import sys
|
import sys
|
||||||
from encodings.punycode import punycode_encode
|
from encodings.punycode import punycode_encode
|
||||||
|
@ -732,7 +731,7 @@ def get_jid_from_iq(iq_obj):
|
||||||
|
|
||||||
def get_auth_sha(sid, initiator, target):
|
def get_auth_sha(sid, initiator, target):
|
||||||
''' return sha of sid + initiator + target used for proxy auth'''
|
''' return sha of sid + initiator + target used for proxy auth'''
|
||||||
return sha.new("%s%s%s" % (sid, initiator, target)).hexdigest()
|
return hash_sha1("%s%s%s" % (sid, initiator, target)).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
distro_info = {
|
distro_info = {
|
||||||
|
|
15
src/gajim.py
15
src/gajim.py
|
@ -37,9 +37,9 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
import warnings
|
|
||||||
warnings.filterwarnings(action='ignore')
|
warnings.filterwarnings(action='ignore')
|
||||||
|
|
||||||
if os.path.isdir('gtk'):
|
if os.path.isdir('gtk'):
|
||||||
|
@ -56,6 +56,11 @@ if os.name == 'nt':
|
||||||
os.environ['GTK_BASEPATH'] = 'gtk'
|
os.environ['GTK_BASEPATH'] = 'gtk'
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
try:
|
||||||
|
import osx
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
# needed for docutils
|
# needed for docutils
|
||||||
|
@ -151,7 +156,6 @@ common.configpaths.gajimpaths.init_profile(profile)
|
||||||
del profile
|
del profile
|
||||||
|
|
||||||
# PyGTK2.10+ only throws a warning
|
# PyGTK2.10+ only throws a warning
|
||||||
import warnings
|
|
||||||
warnings.filterwarnings('error', module='gtk')
|
warnings.filterwarnings('error', module='gtk')
|
||||||
try:
|
try:
|
||||||
import gtk
|
import gtk
|
||||||
|
@ -162,7 +166,6 @@ except Warning, msg:
|
||||||
warnings.resetwarnings()
|
warnings.resetwarnings()
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
import warnings
|
|
||||||
warnings.filterwarnings(action='ignore')
|
warnings.filterwarnings(action='ignore')
|
||||||
|
|
||||||
pritext = ''
|
pritext = ''
|
||||||
|
@ -408,9 +411,8 @@ def on_exit():
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
try:
|
try:
|
||||||
import osx
|
|
||||||
osx.shutdown()
|
osx.shutdown()
|
||||||
except ImportError:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
import atexit
|
import atexit
|
||||||
|
@ -3366,9 +3368,8 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
try:
|
try:
|
||||||
import osx
|
|
||||||
osx.init()
|
osx.init()
|
||||||
except ImportError:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Interface()
|
Interface()
|
||||||
|
|
|
@ -1003,7 +1003,6 @@ change_cursor = None
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import os
|
import os
|
||||||
from common import gajim
|
|
||||||
|
|
||||||
class log(object):
|
class log(object):
|
||||||
|
|
||||||
|
|
|
@ -1726,7 +1726,6 @@ class RosterWindow:
|
||||||
|
|
||||||
def music_track_changed(self, unused_listener, music_track_info,
|
def music_track_changed(self, unused_listener, music_track_info,
|
||||||
account=''):
|
account=''):
|
||||||
from common import pep
|
|
||||||
if account == '':
|
if account == '':
|
||||||
accounts = gajim.connections.keys()
|
accounts = gajim.connections.keys()
|
||||||
if music_track_info is None:
|
if music_track_info is None:
|
||||||
|
@ -2033,13 +2032,8 @@ class RosterWindow:
|
||||||
del gajim.interface.status_sent_to_users[account][contact.jid]
|
del gajim.interface.status_sent_to_users[account][contact.jid]
|
||||||
|
|
||||||
# Delete pep if needed
|
# Delete pep if needed
|
||||||
#FIXME: py2.5only
|
keep_pep = any(c.show not in ('error', 'offline') for c in
|
||||||
# keep_pep = any(c.show not in ('error', 'offline') for c in
|
contact_instances)
|
||||||
# contact_instances)
|
|
||||||
keep_pep = False
|
|
||||||
for c in contact_instances:
|
|
||||||
if c.show not in ('error', 'offline'):
|
|
||||||
keep_pep = True
|
|
||||||
if not keep_pep and contact.jid != gajim.get_jid_from_account(account) \
|
if not keep_pep and contact.jid != gajim.get_jid_from_account(account) \
|
||||||
and not contact.is_groupchat():
|
and not contact.is_groupchat():
|
||||||
pep.delete_pep(contact.jid, account)
|
pep.delete_pep(contact.jid, account)
|
||||||
|
@ -3288,7 +3282,6 @@ class RosterWindow:
|
||||||
if gajim.connections[account].pep_supported:
|
if gajim.connections[account].pep_supported:
|
||||||
# As many implementations don't support retracting items, we send a
|
# As many implementations don't support retracting items, we send a
|
||||||
# "Stopped" event first
|
# "Stopped" event first
|
||||||
from common import pep
|
|
||||||
pep.user_send_tune(account, '')
|
pep.user_send_tune(account, '')
|
||||||
pep.user_retract_tune(account)
|
pep.user_retract_tune(account)
|
||||||
helpers.update_optional_features(account)
|
helpers.update_optional_features(account)
|
||||||
|
|
Loading…
Add table
Reference in a new issue