Changeset 63e947c2925760238574f24e355001205f369996

Show
Ignore:
Timestamp:
08/17/08 15:19:39 (4 months ago)
Author:
Jonny Lamb <jonnylamb@…>
Parents:
6743f68457b7c15796432836bce3918cd8fd907a
Children:
d9ffc7e53b1210c740693d1de2b0143921114cc2
git-committer:
Jonny Lamb <jonnylamb@jonnylamb.com> / 2008-08-17T14:19:39Z+0100
Message:

Removed DecodingFile? class; it doesn't fix the unicode problem.

Signed-off-by: Jonny Lamb <jonnylamb@…>

Location:
debexpo
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • debexpo/lib/plugins.py

    r11b680 r63e947  
    4444 
    4545from debexpo.lib.base import * 
    46 from debexpo.lib.utils import DecodingFile 
    4746 
    4847log = logging.getLogger(__name__) 
     
    125124        # If the original tarball was pulled from Debian or from the repository, that 
    126125        # also needs to be copied into this directory. 
    127         dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) 
     126        dsc = deb822.Dsc(file(self.changes.get_dsc())) 
    128127        for item in dsc['Files']: 
    129128            if item['name'] not in self.changes.get_files(): 
  • debexpo/lib/repository.py

    r2590f5 r63e947  
    4343from sqlalchemy import select 
    4444 
    45 from debexpo.lib.utils import get_package_dir, DecodingFile 
     45from debexpo.lib.utils import get_package_dir 
    4646 
    4747 
     
    8282 
    8383        # Read the dsc file. 
    84         dsc = deb822.Dsc(DecodingFile(filename)) 
     84        dsc = deb822.Dsc(file(filename)) 
    8585 
    8686        # There are a few differences between a dsc file and a Sources entry, listed and acted 
  • debexpo/lib/utils.py

    r11b680 r63e947  
    106106 
    107107    return sum.hexdigest() 
    108  
    109 class DecodingFile(file): 
    110     """ 
    111     Wrapper class to open a file and read it as a specific encoding. This 
    112     is a horrible hack and should be deprecated when deb822 is fixed. 
    113     See Debian bug #495272 for more details. 
    114     """ 
    115     def __init__(self, name, mode='r', buffering=1, encoding='utf8'): 
    116         file.__init__(self, name, mode, buffering) 
    117         self._encoding = encoding 
    118  
    119     def read(self, n=-1): 
    120         data = file.read(self, n) 
    121         return data.decode(self._encoding) 
    122  
    123     def readline(self): 
    124         data = file.readline(self) 
    125         return data.decode(self._encoding) 
  • debexpo/plugins/buildsystem.py

    r11b680 r63e947  
    4141from debexpo.lib import constants 
    4242from debexpo.lib.base import * 
    43 from debexpo.lib.utils import DecodingFile 
    4443from debexpo.plugins import BasePlugin 
    4544 
     
    5453        log.debug('Finding the package\'s build system') 
    5554 
    56         dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) 
     55        dsc = deb822.Dsc(file(self.changes.get_dsc())) 
    5756 
    5857        if 'cdbs' in dsc['Build-Depends']: 
  • debexpo/plugins/controlfields.py

    r11b680 r63e947  
    4141from debexpo.lib import constants 
    4242from debexpo.lib.base import * 
    43 from debexpo.lib.utils import DecodingFile 
    4443from debexpo.plugins import BasePlugin 
    4544 
     
    6766 
    6867        try: 
    69             dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) 
     68            dsc = deb822.Dsc(file(self.changes.get_dsc())) 
    7069        except: 
    7170            log.critical('Could not open dsc file; skipping plugin') 
  • debexpo/plugins/getorigtarball.py

    r11b680 r63e947  
    4343from debexpo.lib import constants 
    4444from debexpo.lib.base import * 
    45 from debexpo.lib.utils import md5sum, DecodingFile 
     45from debexpo.lib.utils import md5sum 
    4646from debexpo.plugins import BasePlugin 
    4747 
     
    5555        actually in the package upload. 
    5656        """ 
    57         dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) 
     57        dsc = deb822.Dsc(file(self.changes.get_dsc())) 
    5858 
    5959        orig = None