~ubuntu-branches/ubuntu/utopic/lazygal/utopic

« back to all changes in this revision

Viewing changes to lazygal/newsize.py

  • Committer: Package Import Robot
  • Author(s): Michal Čihař
  • Date: 2012-05-14 10:26:46 UTC
  • mfrom: (1.2.10)
  • Revision ID: package-import@ubuntu.com-20120514102646-a8aqsadph5u2s2sf
Tags: 0.7.2-1
* New upstream release.
  - Fix video thumbnailing handling (Closes: #662118).
  - Fixes French translation (Closes: #664167).
* Clean generated files in clean phase (Closes: #671317).
* Bump standards to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
 
190
190
 
191
191
def get_newsizer(resize_string):
192
 
    newsizer_it = iter(resize_patterns)
193
 
    try:
194
 
        while True:
195
 
            newsizer_class = newsizer_it.next()
196
 
            newsizer = newsizer_class(resize_string)
197
 
            try:
198
 
                newsizer.matches()
199
 
            except NewsizeStringParseError:
200
 
                # This is not the syntax used
201
 
                pass
202
 
            else:
203
 
                return newsizer
204
 
    except StopIteration:
205
 
        raise NewsizeStringParseError
 
192
    for newsizer_class in resize_patterns:
 
193
        newsizer = newsizer_class(resize_string)
 
194
        try:
 
195
            newsizer.matches()
 
196
        except NewsizeStringParseError:
 
197
            # This is not the syntax used
 
198
            pass
 
199
        else:
 
200
            return newsizer
 
201
    raise NewsizeStringParseError
 
202
 
206
203
 
207
204
def is_known_newsizer(resize_string):
208
 
    newsizer_it = iter(resize_patterns)
209
 
    try:
210
 
        while True:
211
 
            newsizer_class = newsizer_it.next()
212
 
            try:
213
 
                newsizer_class(resize_string).matches()
214
 
            except NewsizeStringParseError:
215
 
                # This is not the syntax used
216
 
                pass
217
 
            else:
218
 
                return True
219
 
    except StopIteration:
220
 
        return False
 
205
    for newsizer_class in resize_patterns:
 
206
        try:
 
207
            newsizer_class(resize_string).matches()
 
208
        except NewsizeStringParseError:
 
209
            # This is not the syntax used
 
210
            pass
 
211
        else:
 
212
            return True
 
213
    raise NewsizeStringParseError
221
214
 
222
215
 
223
216
# vim: ts=4 sw=4 expandtab