Commit graph

3441 commits

Author SHA1 Message Date
Fabrice L.
50ca2c683a Merge pull request #754 from KraYmer/doc_plugins_templ_funcs
doc: add section listing template functions/fields provided by plugins
2014-05-10 23:11:17 +02:00
Fabrice L.
c0f7e1fec4 Merge pull request #747 from KraYmer/issue740_buckets
Issue740: introduce bucket plugin to organize files in bucket directories
2014-05-10 23:04:28 +02:00
Fabrice Laporte
02f7e78fd3 fix flake8 warnings 2014-05-10 10:57:44 +02:00
Fabrice Laporte
21feab7ab1 add tests to check bad buckets definitions
message is now printed to the user when buckets declared in the config
file cannot be parsed
2014-05-10 10:55:38 +02:00
Fabrice Laporte
1303f0a4df Merge branch 'doc_plugins_templ_funcs' of github.com:KraYmer/beets into doc_plugins_templ_funcs
Conflicts:
	docs/reference/pathformat.rst
2014-05-09 09:01:07 +02:00
Fabrice Laporte
c002e4599c Add text to new _templ_plugins section
Replace links to ‘writing-plugin’ by internal links to ‘templ_plugins’.
Add small paragraph at the end of _templ_plugins to mention ‘inline’
plugin and the ‘Writing Plugins’ page.
2014-05-09 08:59:22 +02:00
Fabrice L.
c5babea31f fix typo from copy/paste 2014-05-08 22:27:21 +02:00
Fabrice Laporte
d8008e145f Add section listing template functions/fields provided by plugins for path
formatting
2014-05-08 22:05:26 +02:00
Fabrice Laporte
0d5050bdce fix handling of digits chars in alpha buckets
Characters were search in string.ascii_lowercase that does not contain
digits chars.
2014-05-08 16:13:17 +02:00
Adrian Sampson
3ab8107adf Release script: larger prep command 2014-05-07 20:04:20 -07:00
Adrian Sampson
dd11795cbd Release script: datestamp and version commands 2014-05-07 19:46:04 -07:00
Fabrice Laporte
4add189608 Add option to extrapolate year buckets names
- spans are now tracked via a list of dicts instead of 2 lists
previously (simpler code)
- extend_year_spans() pregenerates all possible ranges at plugin setup
stage
- a BucketError is now raised if declared bucket format not accepted
2014-05-08 01:28:17 +02:00
Adrian Sampson
6ecf4ef6ed Release script: upload command 2014-05-06 22:16:19 -07:00
Adrian Sampson
611be7b4b5 Release script: convert changelog to Markdown 2014-05-06 22:06:28 -07:00
Adrian Sampson
d641927ad8 Fix formatted.get calls 2014-05-06 15:57:04 -07:00
Adrian Sampson
6b3bea99a0 Changelog for faster queries (lazy formatting) 2014-05-06 12:01:13 -07:00
Adrian Sampson
c08e07d31b Property for easy FormattedMapping access 2014-05-06 11:54:56 -07:00
Adrian Sampson
e800b46a5d Make FormattedMapping behave more like a dict
The collections.Mapping abstract base class provides all the nice dict-like
functionality we need.
2014-05-06 11:32:20 -07:00
Adrian Sampson
d30e2f597f Merge pull request #751 from sampsyo/lazy-formatted-mapping
Make _formatted_mapping lazy and an object
2014-05-06 11:16:58 -07:00
Thomas Scholtes
335247481f Make _formatted_mapping lazy and an instance
The motivation for this is to increase the performance of template evalutation.

Previously, the `model._formatted_mapping()` method returned a dictionary that
served as the environment (mapping of variable names to values) when evaluating
a template. To populate the dictionary, we iterated over all keys in the model,
formatted the values, and assigned it to the dictionary. This meant we
formatted every field, even if the template did not require it.

With this commit `_formatted_mapping()` does not return a populated dictionary
but a proxy (or view) instance. The object only knows about the model and the
keys it provides the formatted view for. If a variable is requested by the
template it computes the formatted value on the fly.

The class-based approach has one additional advantage: In the future, we can
separate the formatting logic from the database logic.
2014-05-06 11:24:51 +02:00
Fabrice Laporte
509af59d4e cleanup docstrings and add tests 2014-05-04 08:51:11 +02:00
Fabrice L.
1e7e456f21 Update index.rst
indent line
2014-05-04 08:33:04 +02:00
Fabrice Laporte
a138c4989e include bucket.rst in toc tree 2014-05-04 07:41:02 +02:00
Fabrice L.
8a7f82f354 Update bucket.rst 2014-05-04 07:09:36 +02:00
Fabrice L.
67b3d78b72 Update bucket.rst 2014-05-04 00:04:18 +02:00
Fabrice Laporte
b1d10ed5f9 add bucket plugin doc 2014-05-03 23:48:23 +02:00
Fabrice Laporte
31569baba7 fix range upper bound + tests added 2014-05-03 23:46:31 +02:00
Fabrice Laporte
581bf768ca add buckets plugin + tests
Add a new template functions %bucket(text, field) for path formatting.
2014-05-03 13:55:21 +02:00
Adrian Sampson
066c4e1655 Release script: extract changelog 2014-05-02 14:09:59 -07:00
Adrian Sampson
1613f9b773 Release script: build command 2014-05-02 14:09:59 -07:00
Adrian Sampson
064013605a Changelog for #742 2014-05-01 21:16:48 -07:00
Adrian Sampson
27804ce68b Merge pull request #742 from tsigo/rs-before_item_moved-event
Add before_item_moved event
2014-05-01 21:14:37 -07:00
Adrian Sampson
5b671a0465 Start version-number-bumping utility 2014-05-01 17:38:31 -07:00
Robert Speicher
a7c996d3af Add before_item_moved event
This event gets called just before `util.move` with the same arguments
as the `item_moved` event.
2014-05-01 20:38:07 -04:00
Adrian Sampson
6cc643520d Merge branch 'KraYmer-lyrics-integration-sources' 2014-05-01 08:58:07 -07:00
Adrian Sampson
9b160bb81d Travis: YAML syntax
I feel incredibly dumb.
2014-04-29 22:35:34 -07:00
Adrian Sampson
de2b2ad407 Travis: use explicit $COVERAGE variable
This makes the conditionals a little easier to read.
2014-04-29 22:34:09 -07:00
Adrian Sampson
534c57a78c Travis: one more try
This is horrible. Apparently, I need to *only* use `matrix.include`, none of
the other options (which fill out the matrix automatically).
2014-04-29 22:28:19 -07:00
Adrian Sampson
e29cb67c89 Travis: hopefully fix Travis matrix
The documentation here is completely unclear (does "include" exclude
everything else?). I hope this works.
2014-04-29 22:27:13 -07:00
Adrian Sampson
7f69f90462 Travis: deal with new build environments
The latest Travis updates seem to only install the requested Python.
Previously, we assumed we had all Pythons even when the requested Python was
the default.
2014-04-29 22:21:14 -07:00
Adrian Sampson
9101b88499 Slightly shorter description of autotag
Brevity is the soul of documentation.
2014-04-29 21:57:39 -07:00
Adrian Sampson
78dc45c44c Merge pull request #734 from EvanPurkhiser/doc/import.autotag
Document 'import.autotag' configuration
2014-04-29 21:54:37 -07:00
Evan Purkhiser
63fc7e04e6 docs: Document 'import.autotag' configuration 2014-04-30 00:14:49 -04:00
Adrian Sampson
e19632c11d Merge branch 'master' of github.com:sampsyo/beets 2014-04-29 10:23:30 -07:00
Adrian Sampson
54445882d8 replaygain: Log when files are unsupported 2014-04-29 10:23:07 -07:00
Adrian Sampson
362db8f22f Merge pull request #728 from sampsyo/lastgenre-tests-new
Tests for lastgenre (cleaned up)
2014-04-29 08:38:56 -07:00
Adrian Sampson
2fac1567ec Remove redundant quotes in exception
Indicated in #731.
2014-04-29 08:34:56 -07:00
Adrian Sampson
233f71a457 Use real booleans for whitelist/canonical options
As opposed to the strings "true" and "false".
2014-04-28 23:00:00 -07:00
Adrian Sampson
add309b57d Isolate lastgenre tests
We now appropriately set up and tear down the fixture for the lastgenre tests.
(This was causing unpredictable failures elsewhere before.)
2014-04-28 22:35:32 -07:00
Fabrice L.
f6337d2d1f Update lastgenre.rst 2014-04-28 10:44:53 +02:00