coding standards

This commit is contained in:
Jefry Lagrange 2012-09-22 22:16:03 -04:00
parent f94a8cec1b
commit a8922c32a8
5 changed files with 9 additions and 9 deletions

View File

@ -2003,9 +2003,9 @@ class FileRequestReceivedEvent(nec.NetworkIncomingEvent, HelperEvent):
h = file_tag.getTag('hash')
n = file_tag.getTag('name')
if h:
file_info = self.conn.get_files_info(hash_=h)
file_info = self.conn.get_file_info(hash_=h)
elif n:
file_info = self.conn.get_files_info(name=n)
file_info = self.conn.get_file_info(name=n)
self.file_props.file_name = file_info['file-name']
self.file_props.sender = self.conn._ft_get_our_jid()
self.file_props.receiver = self.fjid

View File

@ -189,12 +189,12 @@ class ConnectionJingle(object):
else:
return sessions
def set_files_info(self, file_):
def set_file_info(self, file_):
# Saves information about the files we have transfered in case they need
# to be requested again.
self.files.append(file_)
def get_files_info(self, hash_=None, name=None):
def get_file_info(self, hash_=None, name=None):
if hash_:
for f in self.files: # DEBUG
#if f['hash'] == '1294809248109223':
@ -217,5 +217,5 @@ class ConnectionJingle(object):
for session in self._sessions.values():
if session.peerjid == jid and session.get_content(media):
return session
return None

View File

@ -203,7 +203,7 @@ class JingleContent(object):
'date' : self.file_props.date,
'peerjid' : pjid
}
self.session.connection.set_files_info(file_info)
self.session.connection.set_file_info(file_info)
desc = file_tag.setTag('desc')
if self.file_props.desc:
desc.setData(self.file_props.desc)

View File

@ -142,7 +142,7 @@ class JingleFileTransfer(JingleContent):
'date' : self.file_props.date,
'peerjid' : pjid
}
self.session.connection.set_files_info(file_info)
self.session.connection.set_file_info(file_info)
def _calcHash(self):
# Caculates the hash and returns a xep-300 hash stanza

View File

@ -522,9 +522,9 @@ class JingleSession(object):
h = request.getTag('file').getTag('hash')
n = request.getTag('file').getTag('name')
if h:
file_info = self.connection.get_files_info(hash_=h)
file_info = self.connection.get_file_info(hash_=h)
elif n:
file_info = self.connection.get_files_info(name=n)
file_info = self.connection.get_file_info(name=n)
pjid = gajim.get_jid_without_resource(self.peerjid)
if not file_info or file_info['peerjid'] != pjid:
log.warning('The peer ' + pjid + \