VCARDPATH --> VCARD_PATH

This commit is contained in:
Nikos Kouremenos 2006-02-15 10:44:41 +00:00
parent 036de12230
commit cb6f163f02
4 changed files with 17 additions and 17 deletions

View File

@ -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):

View File

@ -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)

View File

@ -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:

View File

@ -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)