Changeset 3166

Show
Ignore:
Timestamp:
02/01/08 06:13:58 (8 months ago)
Author:
Blackhex
Message:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • downloadsplugin/0.11/tracdownloads/api.py

    r3114 r3166  
    449449                    path = os.path.join(self.path, to_unicode(download['id']), 
    450450                      download['file']) 
     451                    path = os.path.normpath(path) 
    451452                    self.log.debug('path: %s' % (path,)) 
    452453 
     
    562563 
    563564                # Prepare file paths 
    564                 filepath = os.path.join(self.path, unicode(download['id']), 
    565                   download['file']) 
    566                 filepath = unicodedata.normalize('NFC', filepath) 
    567                 filepath = filepath.replace('\\', '/').replace(':', '/') 
    568                 path = os.path.dirname(filepath) 
     565                path = os.path.join(self.path, unicode(download['id'])) 
     566                filepath = os.path.join(path, download['file']) 
     567                path = os.path.normpath(path) 
     568                filepath = os.path.normpath(filepath) 
    569569                self.log.debug('filepath: %s' % ((filepath,))) 
    570570                self.log.debug('path: %s' % ((path,))) 
     
    629629                        download = self.get_download(context, download_id) 
    630630                        self.log.debug(download) 
     631 
    631632                        try: 
    632633                            self.delete_download(context, download['id']) 
    633                             path = os.path.join(self.path, to_unicode( 
    634                               download['id'])) 
    635                             os.remove(os.path.join(path, download['file'])) 
     634                            path = os.path.join(self.path, 
     635                              to_unicode(download['id'])) 
     636                            filepath = os.path.join(path, download['file']) 
     637                            path = os.path.normpath(path) 
     638                            filepath = os.path.normpath(filepath) 
     639                            os.remove(filepath) 
    636640                            os.rmdir(path) 
    637641 
  • downloadsplugin/0.11/tracdownloads/tags.py

    r3114 r3166  
    44 
    55from trac.core import * 
    6 from trac.mimeview import * 
     6from trac.mimeview import Context 
    77from trac.util.html import html 
    88 
  • downloadsplugin/0.11/tracdownloads/timeline.py

    r3114 r3166  
    11# -*- coding: utf8 -*- 
    2  
    3 import time 
    42 
    53from genshi.builder import tag 
    64 
    75from trac.core import * 
    8 from trac.mimeview import * 
    9 from trac.wiki import wiki_to_html, wiki_to_oneliner 
     6from trac.mimeview import Context 
    107from trac.util.text import pretty_size 
    118