comparison src/memory/cache.py @ 2502:7ad5f2c4e34a

XEP-0065,XEP-0096,XEP-0166,XEP-0235,XEP-0300: file transfer improvments: huge patch sorry :) many things are improved by this patch, notably: - updated to last protocol changes (urn:xmpp:jingle:apps:file-transfer:5 and urn:xmpp:hashes:2) - XEP-0234: file request implementation - XEP-0234: methods to parse and generate <file> element (can be used by other plugins easily) - XEP-0234: range data is now in a namedtuple - path and namespace can be specified when sending/requesting a file (not standard, but needed for file sharing) - better error/termination handling - trigger points to handle file requests by other plugins - preparation to use file plugins with components
author Goffi <goffi@goffi.org>
date Wed, 28 Feb 2018 18:28:39 +0100
parents 0046283a285d
children 516bf5309517
comparison
equal deleted inserted replaced
2501:3b67fe672206 2502:7ad5f2c4e34a
30 30
31 class Cache(object): 31 class Cache(object):
32 """generic file caching""" 32 """generic file caching"""
33 33
34 def __init__(self, host, profile=None): 34 def __init__(self, host, profile=None):
35 host = host
36 self.profile = profile 35 self.profile = profile
37 self.cache_dir = os.path.join( 36 self.cache_dir = os.path.join(
38 host.memory.getConfig('', 'local_dir'), 37 host.memory.getConfig('', 'local_dir'),
39 C.CACHE_DIR, 38 C.CACHE_DIR,
40 regex.pathEscape(profile or '')) 39 regex.pathEscape(profile or ''))