Changeset 4643
- Timestamp:
- 10/29/08 07:31:13 (2 months ago)
- Files:
-
- downloadsplugin/0.11/tracdownloads/api.py (modified) (1 diff)
- downloadsplugin/0.11/tracdownloads/tags.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
downloadsplugin/0.11/tracdownloads/api.py
r4558 r4643 815 815 raise TracError('Can\'t upload empty file.') 816 816 817 # Strip path from filename. 818 self.log.debug(file.filename) 819 filename = os.path.basename(file.filename).decode('utf-8') 820 self.log.debug(filename) 817 # Try to normalize the filename to unicode NFC if we can. 818 # Files uploaded from OS X might be in NFD. 819 self.log.debug('input filename: %s', (file.filename,)) 820 filename = unicodedata.normalize('NFC', to_unicode(file.filename, 821 'utf-8')) 822 filename = filename.replace('\\', '/').replace(':', '/') 823 filename = os.path.basename(filename) 824 self.log.debug('output filename: %s', (filename,)) 821 825 822 826 return file.file, filename, size downloadsplugin/0.11/tracdownloads/tags.py
r4558 r4643 52 52 53 53 # Create temporary resource. 54 resource = Resource() 55 resource.realm = 'downloads' 56 resource.id = old_download['id'] 54 resource = Resource('downloads', old_download['id']) 57 55 58 56 # Delete old tags. … … 66 64 def download_deleted(self, req, download): 67 65 # Create temporary resource. 68 resource = Resource() 69 resource.realm = 'downloads' 70 resource.id = download['id'] 66 resource = Resource('downloads', download['id']) 71 67 72 68 # Delete tags of download.
