Commit Graph

16 Commits

Author SHA1 Message Date
Jens Luetjen
b55996da6a Changed wording export/restore to save/load 2016-04-02 16:28:04 +02:00
Jens Luetjen
6e33bbcadd Replace restore/export with load/save
Rename _restore_state to _load_state
Rename _export_state to _save_state
2016-04-01 19:50:37 +02:00
Jens Luetjen
4869619bb9 New CoreState to hold all core states
- Introduce a CoreState class that holds all core states
- Move xState classes to internal
- Use validation.check_instance for consistent error messages
- Store tlid instead of TlTrack to restore last played track
2016-01-10 13:24:14 +01:00
Jens Luetjen
e56c39ee78 Add unit tests for export/restore core state
Fix issues shown by test code
2016-01-03 18:29:35 +01:00
Stein Magnus Jodal
0c059b85b1 compat: Replace (int, long) with compat.integer_types 2015-10-29 22:21:48 +01:00
Bjørnar Snoksrud
1eb41aca7d tests: fix test breakage due to promotion from int to long
This fixes #1240.

In internals/path.py. there is a snippet of code that multiples mtime
for a file with 1000, and then casting it to `int`, to return the number
of milliseconds since epoch (or whatever). This will, however, not
ensure that the result is an `int`.

>>> type(int(2**32))
<type 'long'>

Instead, fix the tests to look for (int, long), and clarify the
implementation.

This bug found on a 32-bit VM :)
2015-08-05 22:38:21 +02:00
Stein Magnus Jodal
861f60e6f1 core: Make history.add() private
Instead of changing the signature to add(uri, name) I opted for
renaming it to _add_track(track).

Since it's internal we may change it whenever we like to. Since you need
different logic for extracting an interesting name from a track and from
a ref or a stream title, it makes sense to add another method for adding
refs/stream titles to the history when that time comes.

Fixes #1056
2015-03-20 22:41:56 +01:00
Thomas Adamcik
fa8547c397 tests: Add noqa markers for setUp/tearDown 2014-12-30 00:23:01 +01:00
Stein Magnus Jodal
496142c201 py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
Stein Magnus Jodal
5317834baf history: Change size property to get_length() method
For consistency with tracklist.get_length() and our goal of aligning Python
and JS APIs by using less properties in the core API.
2014-09-23 18:47:54 +02:00
Stein Magnus Jodal
5a67339855 history: Cleanup history entry test 2014-09-23 18:47:39 +02:00
Stein Magnus Jodal
d30cf68efd history: Raise TypeError if non-Tracks are added 2014-09-23 18:42:41 +02:00
Stein Magnus Jodal
718405421d history: Rename class to HistoryController
For consistency with other core controllers.
2014-09-23 18:32:37 +02:00
Arjun Naik
c38b9f378f Use assertIn instead of assertTrue to test membership. 2014-09-23 18:09:12 +02:00
Arjun Naik
9006968f75 TrackHistory stores Ref instances. Timestamp as epoch in milliseconds also stored. 2014-09-23 18:09:12 +02:00
Arjun Naik
ed87ab8dd1 Added a playback history object to the core. 2014-09-23 18:09:11 +02:00