Commit Graph

75 Commits

Author SHA1 Message Date
Stein Magnus Jodal
9becb26f60 path: Get XDG dirs without using glib
Related to #1068
2015-04-07 23:50:59 +02:00
Stein Magnus Jodal
c4940cbea2 autopep8: Add space after class signature/docstring 2015-04-03 00:05:26 +02:00
Stein Magnus Jodal
4972d1da57 Decode all strerror-based exception messages
I reviewed all instances of:

- EnvironmentError
- OSError
- IOError
- socket.error

In most cases, we already used encoding.locale_decode().

The case fixed in mopidy/utils/network.py fixes #971.

The case fixed in mopidy/utils/path.py might be triggered during a
local library scan.
2015-03-17 22:02:34 +01:00
Stein Magnus Jodal
3a61445519 models: Change Track.last_modified from seconds to ms 2015-03-14 00:06:23 +01:00
Stein Magnus Jodal
6ec35b2d02 Merge branch 'release/v0.19.x' into develop 2014-12-23 22:23:32 +01:00
Stein Magnus Jodal
aa3b8ab5f8 path: Support unicode content when creating file 2014-12-23 22:21:10 +01:00
Thomas Adamcik
2c3217685b utils: Switch to exceptions.FindError for errors. 2014-12-14 14:08:45 +01:00
Stein Magnus Jodal
4f428b8601 py3: Move compat module out of utils 2014-12-07 21:36:15 +01:00
Stein Magnus Jodal
01c7f12976 py3: Import moved modules via compat 2014-12-07 20:19:01 +01:00
Stein Magnus Jodal
1d26c2d63c py3: Use .item() and .values()
As .iteritem() and .itervalues() doesn't exist in Python 3.
2014-12-07 20:19:01 +01:00
Stein Magnus Jodal
58527406c1 py3: Use compat.text_type instead of unicode 2014-12-07 20:17:10 +01:00
Stein Magnus Jodal
496142c201 py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
Thomas Adamcik
369edab76d utils/path: Make it more clear that we are not following symlinks 2014-10-17 20:08:12 +02:00
Thomas Adamcik
43d8062094 util/path: s/os.error/OSError/ 2014-10-17 16:46:33 +02:00
Thomas Adamcik
063c757570 utils/path: Add support for handling sym/hardlink loops 2014-10-15 23:46:08 +02:00
Thomas Adamcik
54a89038d3 utils/path: Don't skip hidden files and folders in generic find code
Updates the local scan code to do this instead.
2014-10-15 23:45:49 +02:00
Thomas Adamcik
ebb62885cd util/path: Add basic support for following symlinks 2014-10-15 23:44:48 +02:00
Thomas Adamcik
de5fe5ebab tests: Add test for current find symlink handling 2014-10-15 23:43:13 +02:00
Thomas Adamcik
de4bdbec03 tests: Minor cleanup of the existing find tests 2014-10-15 23:42:15 +02:00
Thomas Adamcik
2447e2fa40 util/path: Expose errors to callers of find helper 2014-10-15 23:42:12 +02:00
Stein Magnus Jodal
cd3d44ff6d py3: Use '0o' octal literal 2014-09-16 09:48:38 +02:00
Stein Magnus Jodal
b754885064 Fix all import order warnings 2014-05-07 20:08:43 +02:00
Stein Magnus Jodal
db7aff4512 utils: Tweak docstrings from PR#707 2014-03-02 09:00:47 +01:00
Thomas Adamcik
7386dd30b6 utils: Remove old find_files 2014-02-26 23:53:12 +01:00
Thomas Adamcik
5b7a6065e7 util: Add find_mtimes helper 2014-02-26 23:27:44 +01:00
Thomas Adamcik
4e332da3ed utils: Update find to be threaded.
This is needed to speedup searches when using network mounted directories where
we are heavily IO bound.
2014-02-26 23:10:08 +01:00
Stein Magnus Jodal
0fb7c79524 log: Use loggers named after __name__ 2014-01-01 13:31:20 +01:00
Thomas Adamcik
603b57ef3c utils: Remove find_uris and update find_files
- find_uris is no more
- find_files now returns file paths relative to path being searched
- find_files now only works on directories
- find_files tests have been updated to reflect changes
- local scanner has gotten a minimal update to reflect this alteration
2013-11-27 22:50:35 +01:00
Thomas Adamcik
b22d7bee0b utils: Add mkdir and content options to get_or_create_file
This lets callers control is parent directories are created, and set the
default content of the file.
2013-11-22 07:17:02 +01:00
Stein Magnus Jodal
404fb00235 Remove pylint remnants 2013-08-08 21:12:42 +02:00
Thomas Adamcik
18ed7c6279 local: Convert mopidy-local extension to local: uris.
- Use local:playlist:<name>, local:track:<path> and local:search uris
- Adds LocalPlaybackProvider which translates to file uris.
- Switches to storing actual uris in playlists - so local: urls and not
  file:// or plain paths.
- Moved file:// to streaming plugin
- Cleaned up tests and imports for these changes.
2013-07-30 00:40:12 +02:00
Thomas Adamcik
6818e20218 utils: Convert path_to_uri to single argument 2013-07-30 00:23:23 +02:00
Thomas Adamcik
af707dfdbb utils: Switch to urlparse for file-uri/path handling 2013-07-30 00:23:23 +02:00
Thomas Adamcik
351589c6c8 path: Add find_uris version of find_files 2013-05-20 22:42:31 +02:00
Thomas Adamcik
a7b6ff7b18 path: Disallow unknown substitutions in expand_path 2013-04-25 22:39:07 +02:00
Thomas Adamcik
160a70e6df path: Only accept bytes as paths 2013-04-25 21:08:33 +02:00
Stein Magnus Jodal
004fe6dbf8 path: Handle XDG paths as bytes, not unicode 2013-04-23 23:18:16 +02:00
Stein Magnus Jodal
02f9db4518 path: Let get_or_create_file() create missing dirs 2013-04-09 12:40:28 +02:00
Stein Magnus Jodal
53827aa022 path: Close create file right away 2013-04-09 12:39:29 +02:00
Stein Magnus Jodal
ef57c90526 path: Use our expand_path instead of os.path.expanduser 2013-04-09 00:09:33 +02:00
Stein Magnus Jodal
41d7ae9a2c Replace 'folder' with 'dir' 2013-04-08 21:13:59 +02:00
Stein Magnus Jodal
335c4d9fd8 main/path: Inline constants used once 2013-04-08 20:42:33 +02:00
Stein Magnus Jodal
2276130758 main: Use new config system 2013-04-07 00:34:24 +02:00
Thomas Adamcik
5214100854 config: Expand files before printing sources. 2013-04-02 23:58:13 +02:00
Stein Magnus Jodal
d9300f72bd scanner: Support symlinks 2013-03-12 19:59:19 +01:00
Stein Magnus Jodal
0f603c3ede Use urllib.{quote,unquote} instead of {pathname2url,url2pathname} 2012-12-12 23:13:52 +01:00
Stein Magnus Jodal
905ceeb72a utils: find_files() returns bytestrings 2012-12-12 13:45:37 +01:00
Stein Magnus Jodal
b5d9dc10a7 utils: Handle paths with non-UTF-8 encodings
- path_to_uri() encodes unicode input as UTF-8 and leaves bytestring input
  unchanged before it is converted to file:// URIs.

- uri_to_path() will now always return bytestrings, since we don't know if
  there is any non-UTF-8 encoded chars in the file path, and converting it to
  unicode would make such paths no longer match the dir or file it was
  referring to.

- split_path() will now assume it gets a bytestring in.
2012-12-12 13:45:37 +01:00
Stein Magnus Jodal
ec639d17ae docs: Unbreak build 2012-11-23 12:47:57 +01:00
Stein Magnus Jodal
d153fa6b59 Remove rogue commas making tuples of my strings 2012-11-21 10:42:33 +01:00