From cb6f163f02736632f495eef0cf576c98abb5d7cf Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 15 Feb 2006 10:44:41 +0000 Subject: [PATCH] VCARDPATH --> VCARD_PATH --- src/common/check_paths.py | 16 ++++++++-------- src/common/connection.py | 8 ++++---- src/common/gajim.py | 8 ++++---- src/gtkgui_helpers.py | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/common/check_paths.py b/src/common/check_paths.py index 59f3d2fcb..b4b909fdf 100644 --- a/src/common/check_paths.py +++ b/src/common/check_paths.py @@ -73,9 +73,9 @@ def create_log_db(): def check_and_possibly_create_paths(): LOG_DB_PATH = logger.LOG_DB_PATH - VCARDPATH = gajim.VCARDPATH + VCARD_PATH = gajim.VCARD_PATH AVATAR_PATH = gajim.AVATAR_PATH - dot_gajim = os.path.dirname(VCARDPATH) + dot_gajim = os.path.dirname(VCARD_PATH) if os.path.isfile(dot_gajim): print _('%s is file but it should be a directory') % dot_gajim print _('Gajim will now exit') @@ -85,10 +85,10 @@ def check_and_possibly_create_paths(): if s.st_mode & stat.S_IROTH: # others have read permission! os.chmod(dot_gajim, 0700) # rwx------ - if not os.path.exists(VCARDPATH): - self.create_path(VCARDPATH) - elif os.path.isfile(VCARDPATH): - print _('%s is file but it should be a directory') % VCARDPATH + if not os.path.exists(VCARD_PATH): + self.create_path(VCARD_PATH) + elif os.path.isfile(VCARD_PATH): + print _('%s is file but it should be a directory') % VCARD_PATH print _('Gajim will now exit') sys.exit() @@ -109,8 +109,8 @@ def check_and_possibly_create_paths(): else: # dot_gajim doesn't exist if dot_gajim: # is '' on win9x so avoid that self.create_path(dot_gajim) - if not os.path.isdir(VCARDPATH): - self.create_path(VCARDPATH) + if not os.path.isdir(VCARD_PATH): + self.create_path(VCARD_PATH) if not os.path.exists(AVATAR_PATH): self.create_path(AVATAR_PATH) if not os.path.isfile(LOG_DB_PATH): diff --git a/src/common/connection.py b/src/common/connection.py index 9d431abda..fbec01b65 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -294,7 +294,7 @@ class Connection: card.getTag('PHOTO').setTagData('SHA', avatar_sha) # Save it to file - path_to_file = os.path.join(gajim.VCARDPATH, frm) + path_to_file = os.path.join(gajim.VCARD_PATH, frm) fil = open(path_to_file, 'w') fil.write(str(card)) fil.close() @@ -1581,7 +1581,7 @@ class Connection: # Save it to file our_jid = gajim.get_jid_from_account(self.name) - path_to_file = os.path.join(gajim.VCARDPATH, our_jid) + path_to_file = os.path.join(gajim.VCARD_PATH, our_jid) fil = open(path_to_file, 'w') fil.write(str(vcard_iq)) fil.close() @@ -1609,7 +1609,7 @@ class Connection: self.dispatch('VCARD', {'jid': jid}) jid = gajim.get_jid_without_resource(jid) # Write an empty file - path_to_file = os.path.join(gajim.VCARDPATH, jid) + path_to_file = os.path.join(gajim.VCARD_PATH, jid) fil = open(path_to_file, 'w') fil.close() del self.awaiting_answers[id] @@ -2283,7 +2283,7 @@ class Connection: return {} if vcard was too old return None if we don't have cached vcard''' jid = gajim.get_jid_without_resource(fjid) - path_to_file = os.path.join(gajim.VCARDPATH, jid) + path_to_file = os.path.join(gajim.VCARD_PATH, jid) if os.path.isfile(path_to_file): # We have the vcard cached f = open(path_to_file) diff --git a/src/common/gajim.py b/src/common/gajim.py index c700b9a72..75cea6a87 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -52,17 +52,17 @@ if os.name == 'nt': try: # Documents and Settings\[User Name]\Application Data\Gajim LOGPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Logs') # deprecated - VCARDPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Vcards') + VCARD_PATH = os.path.join(os.environ['appdata'], 'Gajim', 'Vcards') AVATAR_PATH = os.path.join(os.environ['appdata'], 'Gajim', 'Avatars') except KeyError: # win9x, in cwd LOGPATH = 'Logs' # deprecated - VCARDPATH = 'Vcards' + VCARD_PATH = 'Vcards' AVATAR_PATH = 'Avatars' else: # Unices DATA_DIR = '../data' LOGPATH = os.path.expanduser('~/.gajim/logs') # deprecated - VCARDPATH = os.path.expanduser('~/.gajim/vcards') + VCARD_PATH = os.path.expanduser('~/.gajim/vcards') AVATAR_PATH = os.path.expanduser('~/.gajim/avatars') HOME_DIR = os.path.expanduser('~') @@ -70,7 +70,7 @@ TMP = tempfile.gettempdir() try: LOGPATH = LOGPATH.decode(sys.getfilesystemencoding()) - VCARDPATH = VCARDPATH.decode(sys.getfilesystemencoding()) + VCARD_PATH = VCARD_PATH.decode(sys.getfilesystemencoding()) TMP = TMP.decode(sys.getfilesystemencoding()) AVATAR_PATH = AVATAR_PATH.decode(sys.getfilesystemencoding()) except: diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 5a6180b8f..8a29b7b19 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -445,7 +445,7 @@ def get_avatar_pixbuf_from_cache(jid): # don't show avatar for the transport itself return None - if jid not in os.listdir(gajim.VCARDPATH): + if jid not in os.listdir(gajim.VCARD_PATH): return 'ask' vcard_dict = gajim.connections.values()[0].get_cached_vcard(jid)