Changeset 63e947c2925760238574f24e355001205f369996
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r11b680
|
r63e947
|
|
| 44 | 44 | |
| 45 | 45 | from debexpo.lib.base import * |
| 46 | | from debexpo.lib.utils import DecodingFile |
| 47 | 46 | |
| 48 | 47 | log = logging.getLogger(__name__) |
| … |
… |
|
| 125 | 124 | # If the original tarball was pulled from Debian or from the repository, that |
| 126 | 125 | # 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())) |
| 128 | 127 | for item in dsc['Files']: |
| 129 | 128 | if item['name'] not in self.changes.get_files(): |
-
|
r2590f5
|
r63e947
|
|
| 43 | 43 | from sqlalchemy import select |
| 44 | 44 | |
| 45 | | from debexpo.lib.utils import get_package_dir, DecodingFile |
| | 45 | from debexpo.lib.utils import get_package_dir |
| 46 | 46 | |
| 47 | 47 | |
| … |
… |
|
| 82 | 82 | |
| 83 | 83 | # Read the dsc file. |
| 84 | | dsc = deb822.Dsc(DecodingFile(filename)) |
| | 84 | dsc = deb822.Dsc(file(filename)) |
| 85 | 85 | |
| 86 | 86 | # There are a few differences between a dsc file and a Sources entry, listed and acted |
-
|
r11b680
|
r63e947
|
|
| 106 | 106 | |
| 107 | 107 | 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) |
-
|
r11b680
|
r63e947
|
|
| 41 | 41 | from debexpo.lib import constants |
| 42 | 42 | from debexpo.lib.base import * |
| 43 | | from debexpo.lib.utils import DecodingFile |
| 44 | 43 | from debexpo.plugins import BasePlugin |
| 45 | 44 | |
| … |
… |
|
| 54 | 53 | log.debug('Finding the package\'s build system') |
| 55 | 54 | |
| 56 | | dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) |
| | 55 | dsc = deb822.Dsc(file(self.changes.get_dsc())) |
| 57 | 56 | |
| 58 | 57 | if 'cdbs' in dsc['Build-Depends']: |
-
|
r11b680
|
r63e947
|
|
| 41 | 41 | from debexpo.lib import constants |
| 42 | 42 | from debexpo.lib.base import * |
| 43 | | from debexpo.lib.utils import DecodingFile |
| 44 | 43 | from debexpo.plugins import BasePlugin |
| 45 | 44 | |
| … |
… |
|
| 67 | 66 | |
| 68 | 67 | try: |
| 69 | | dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) |
| | 68 | dsc = deb822.Dsc(file(self.changes.get_dsc())) |
| 70 | 69 | except: |
| 71 | 70 | log.critical('Could not open dsc file; skipping plugin') |
-
|
r11b680
|
r63e947
|
|
| 43 | 43 | from debexpo.lib import constants |
| 44 | 44 | from debexpo.lib.base import * |
| 45 | | from debexpo.lib.utils import md5sum, DecodingFile |
| | 45 | from debexpo.lib.utils import md5sum |
| 46 | 46 | from debexpo.plugins import BasePlugin |
| 47 | 47 | |
| … |
… |
|
| 55 | 55 | actually in the package upload. |
| 56 | 56 | """ |
| 57 | | dsc = deb822.Dsc(DecodingFile(self.changes.get_dsc())) |
| | 57 | dsc = deb822.Dsc(file(self.changes.get_dsc())) |
| 58 | 58 | |
| 59 | 59 | orig = None |