Commit graph

32 commits

Author SHA1 Message Date
Adrian Sampson
71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Johnny Robeson
b99a6acc54 use next() instead of iter.next() throughout 2016-05-27 17:00:40 -04:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
95e940b9f2 Removed unicode_literals from module util 2016-02-20 11:16:55 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
c8d24c748e Import unicode_literals in beets.util
The hardest conversio is (by far) functemplate. It will also reguire a
great length of adaptation for python3, since the grammar of the
language changes and several functions (such as ast.arguments and
ast.FunctionDef) take additional mandatory parameters that don't exist
in python2.
2015-01-19 14:53:05 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Thomas Scholtes
495c49703c Add pipeline.mutator_stage 2014-04-19 19:04:49 +02:00
Thomas Scholtes
d8362fd03c Add pipeline.stage decorator 2014-04-19 18:54:29 +02:00
Adrian Sampson
a45ac4a9d6 enable unused import checking
The "noqa" marker is for exceptions such as these.
2014-04-13 20:48:30 -07:00
Thomas Scholtes
883e3b3bc7 Flake8 fixes 2014-04-10 15:56:50 +02:00
Thomas Scholtes
0abf41e2fb Use Pipline.push() in importer stages 2014-02-01 15:01:05 +01:00
Thomas Scholtes
565a284c03 Add pull() generator to Pipeline 2014-02-01 13:43:05 +01:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Mike Kazantsev
8b07ea157d Fix inconsistent three-space indentation 2012-10-20 21:45:14 +06:00
Adrian Sampson
3de2b7f090 pipeline: allow non-generator iterators 2012-10-09 10:35:48 -07:00
Adrian Sampson
429af42e14 use print_function __future__ import
All code should now use Python 3-style "print"s.
2012-05-13 21:08:27 -07:00
Adrian Sampson
f6b37d2c8c remove with_statement __future__ imports
This is the first of several commits that will modernize the beets codebase for
Python 2.6 conventions. (Compatibility with Python 2.5 is hereby abandoned.)
2012-05-13 20:39:07 -07:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
fabaf41ecf never invalidate a queue with None
I saw this *extremely* intermittently (and wasn't able to reproduce it at all),
but I think there was a race when invalidating an output queue in the abort()
method of PipelineThread. It was possible for a thread's input queue to be
invalidated (with val=None) while abort_flag was False (and abort_lock was not
held). This would cause coroutines to see a None value when the pipeline was
shutting down. Always poisoning a queue when it's invalidated should solve this
by making the thread break before sending the value to the coroutine.
2011-12-22 18:05:54 -08:00
Adrian Sampson
69f392c8f2 fix deadlock in pipeline: notifyAll instead of notify 2011-05-05 22:03:14 -07:00
Adrian Sampson
828f1aa4f1 multiple() function for sending many messages to next stage 2011-04-17 08:18:54 -07:00
Adrian Sampson
85cd3cdb84 add pipeline tests, fixing a bug with parallel stages in the process 2011-04-17 07:57:56 -07:00
Adrian Sampson
0460d73e5e more frequent and better-synchronized abort checks
Previously, if an abort occurred during a queue read, then the queue would
return None. With this extra check, the None is never exposed to the user code
(coroutine).
2011-04-12 14:04:30 -07:00
Adrian Sampson
fcee8b2ab6 remove special-cased non-autotagged import function (simple_import) 2011-04-12 13:57:05 -07:00
Adrian Sampson
494c0f4d0e handle KeyboardInterrupts in pipeline.py 2011-04-12 00:04:11 -07:00
Adrian Sampson
7600a8c0ad pipeline revamp: parallel stages, immediate exception abort
The pipeline module now support stages that have multiple threads working in
parallel; this can bring ordinary task parallelism to parts of a pipelined
workflow. This change also involves making the pipeline terminate immediately
when an exception is raised in a coroutine.
2011-04-11 23:52:51 -07:00
Peter B
e7782cc369 fixed issue in pipeline when the first coro sends the BUBBLE message 2011-04-11 12:31:17 -04:00
Adrian Sampson
2746f1ff3f move pipeline into new beets.util package
--HG--
rename : beets/ui/pipeline.py => beets/util/pipeline.py
2011-04-10 21:19:07 -07:00
Renamed from beets/ui/pipeline.py (Browse further)