diff options
| author | jvoisin | 2011-12-24 01:21:31 +0100 |
|---|---|---|
| committer | jvoisin | 2011-12-24 01:21:31 +0100 |
| commit | afbfe94cf082d71f492b98e442441cc01f6271c2 (patch) | |
| tree | 45702b5acb7584a3ff179ed47939e8d240ec28a7 /mat | |
| parent | 72980c74513f20b7b5f3e42a5bf1c8c50dda17d9 (diff) | |
Rename "ugly" to ""strict"0.2.1
Diffstat (limited to 'mat')
| -rw-r--r-- | mat/archive.py | 12 | ||||
| -rw-r--r-- | mat/office.py | 6 | ||||
| -rw-r--r-- | mat/parser.py | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/mat/archive.py b/mat/archive.py index 65527d2..9993102 100644 --- a/mat/archive.py +++ b/mat/archive.py | |||
| @@ -41,16 +41,16 @@ class GenericArchiveStripper(parser.GenericParser): | |||
| 41 | ''' | 41 | ''' |
| 42 | return self._remove_all('normal') | 42 | return self._remove_all('normal') |
| 43 | 43 | ||
| 44 | def remove_all_ugly(self): | 44 | def remove_all_strict(self): |
| 45 | ''' | 45 | ''' |
| 46 | call remove_all() with in argument : "ugly" | 46 | call remove_all() with in argument : "strict" |
| 47 | ''' | 47 | ''' |
| 48 | return self._remove_all('ugly') | 48 | return self._remove_all('strict') |
| 49 | 49 | ||
| 50 | def _remove_all(self, method): | 50 | def _remove_all(self, method): |
| 51 | ''' | 51 | ''' |
| 52 | Remove all meta, normal way if method is "normal", | 52 | Remove all meta, normal way if method is "normal", |
| 53 | else, use the ugly way (with possible data loss) | 53 | else, use the strict way (with possible data loss) |
| 54 | ''' | 54 | ''' |
| 55 | raise NotImplementedError | 55 | raise NotImplementedError |
| 56 | 56 | ||
| @@ -146,7 +146,7 @@ harmless format' % item.filename) | |||
| 146 | if method is 'normal': | 146 | if method is 'normal': |
| 147 | cfile.remove_all() | 147 | cfile.remove_all() |
| 148 | else: | 148 | else: |
| 149 | cfile.remove_all_ugly() | 149 | cfile.remove_all_strict() |
| 150 | logging.debug('Processing %s from %s' % (item.filename, | 150 | logging.debug('Processing %s from %s' % (item.filename, |
| 151 | self.filename)) | 151 | self.filename)) |
| 152 | zipout.write(name, item.filename) | 152 | zipout.write(name, item.filename) |
| @@ -193,7 +193,7 @@ class TarStripper(GenericArchiveStripper): | |||
| 193 | if method is 'normal': | 193 | if method is 'normal': |
| 194 | cfile.remove_all() | 194 | cfile.remove_all() |
| 195 | else: | 195 | else: |
| 196 | cfile.remove_all_ugly() | 196 | cfile.remove_all_strict() |
| 197 | tarout.add(name, item.name, filter=self._remove) | 197 | tarout.add(name, item.name, filter=self._remove) |
| 198 | except: | 198 | except: |
| 199 | logging.info('%s\' format is not supported or harmless' % | 199 | logging.info('%s\' format is not supported or harmless' % |
diff --git a/mat/office.py b/mat/office.py index e3febba..e1d738e 100644 --- a/mat/office.py +++ b/mat/office.py | |||
| @@ -87,7 +87,7 @@ class OpenDocumentStripper(archive.GenericArchiveStripper): | |||
| 87 | if method == 'normal': | 87 | if method == 'normal': |
| 88 | cfile.remove_all() | 88 | cfile.remove_all() |
| 89 | else: | 89 | else: |
| 90 | cfile.remove_all_ugly() | 90 | cfile.remove_all_strict() |
| 91 | logging.debug('Processing %s from %s' % (item, | 91 | logging.debug('Processing %s from %s' % (item, |
| 92 | self.filename)) | 92 | self.filename)) |
| 93 | zipout.write(name, item) | 93 | zipout.write(name, item) |
| @@ -150,7 +150,7 @@ class PdfStripper(parser.GenericParser): | |||
| 150 | return self._remove_meta() | 150 | return self._remove_meta() |
| 151 | 151 | ||
| 152 | 152 | ||
| 153 | def remove_all_ugly(self): | 153 | def remove_all_strict(self): |
| 154 | ''' | 154 | ''' |
| 155 | Opening the PDF with poppler, then doing a render | 155 | Opening the PDF with poppler, then doing a render |
| 156 | on a cairo pdfsurface for each pages. | 156 | on a cairo pdfsurface for each pages. |
| @@ -261,7 +261,7 @@ class OpenXmlStripper(archive.GenericArchiveStripper): | |||
| 261 | if method == 'normal': | 261 | if method == 'normal': |
| 262 | cfile.remove_all() | 262 | cfile.remove_all() |
| 263 | else: | 263 | else: |
| 264 | cfile.remove_all_ugly() | 264 | cfile.remove_all_strict() |
| 265 | logging.debug('Processing %s from %s' % (item, | 265 | logging.debug('Processing %s from %s' % (item, |
| 266 | self.filename)) | 266 | self.filename)) |
| 267 | zipout.write(name, item) | 267 | zipout.write(name, item) |
diff --git a/mat/parser.py b/mat/parser.py index 651b244..6dc5d0b 100644 --- a/mat/parser.py +++ b/mat/parser.py | |||
| @@ -78,7 +78,7 @@ class GenericParser(object): | |||
| 78 | except: | 78 | except: |
| 79 | return False | 79 | return False |
| 80 | 80 | ||
| 81 | def remove_all_ugly(self): | 81 | def remove_all_strict(self): |
| 82 | ''' | 82 | ''' |
| 83 | If the remove_all() is not efficient enough, | 83 | If the remove_all() is not efficient enough, |
| 84 | this method is implemented : | 84 | this method is implemented : |
