Commit graph

21 commits

Author SHA1 Message Date
Jacob Gillespie
b4efecb709 Add option to hardlink when importing 2017-02-19 15:56:13 -06:00
Adrian Sampson
a88682e7bb Undo from _common import unittest indirection
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
Adrian Sampson
e16cc58cb9 Walk back some six.iter* uses
In places where it doesn't much matter whether we use an iterator or the old
Python 2 list way, using the six name just hurts legibility.
2016-06-25 18:29:55 -07:00
Johnny Robeson
edb1cbc5fc replace iter{items|values} with six.iter{items|values} 2016-06-24 05:53:55 -04:00
Johnny Robeson
ffa46a185c bytestring normalization
Make sure many/most strings that touch the filesystem are
converted explicitly to bytestrings rather than implictly.
2016-06-13 05:39:09 -04:00
Johnny Robeson
92950ec532 wrap keys() result in a list() in importadded tests 2016-06-12 18:17:27 -04:00
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
Jack Wilsdon
b1c58e99ec Update code to match pep8 naming standards 2016-04-27 20:15:10 +01: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
c39a8ce652 Removed unicode_literals from test_importadded 2016-02-22 16:37:11 +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
53c21330c2 All tests use unicode_literals 2015-01-20 15:58:02 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +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
Bruno Cauet
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +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
Stig Inge Lea Bjørnsen
a2188d475b ImportAdded support for in-place and link imports
Fix for the `ImportAdded` plugin crashing during in-place imports (#1107).

Add support for the new link imports introduced in Beets 1.3.9.

Note that link-imports that preserve file modification times will follow
the links and preserve the mtimes on the link targets. The mtimes on the
links aren't modified.
2014-12-25 21:39:28 +01:00
Adrian Sampson
832d658571 Use assertAlmostEqual (#1054)
Rounding and then comparing could lead to some surprising sensitivity. This
uses a known-good approximate comparison.
2014-11-01 13:08:07 -07:00
Adrian Sampson
256a3b4055 Tiny formatting tweaks (#1054) 2014-11-01 12:49:44 -07:00
Stig Inge Lea Bjørnsen
afee48379d Add tests for the importadded plugin
The tests verifies that the `importadded` plugin updates added dates and
mtimes when importing:

* an album
* an album with file mtime preservation on
* singletons
* singletons with file mtime preservation on

It also verifies the the plugin doesn't update added dates when
re-importing:

* an album
* singletons
2014-11-01 15:32:27 +01:00