Commit Graph

33 Commits

Author SHA1 Message Date
Thomas Adamcik
774e629425 config: Fix review comments. 2013-11-23 07:18:57 +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
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
71618f840f scanner: Fixing review comments. 2013-05-22 20:36:39 +02:00
Thomas Adamcik
351589c6c8 path: Add find_uris version of find_files 2013-05-20 22:42:31 +02:00
Stein Magnus Jodal
52ee456692 tests: Import unittest directly from the stdlib 2013-04-29 19:45:25 +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
40dd539d06 path: Test get_or_create_file() 2013-04-09 12:38:47 +02:00
Stein Magnus Jodal
41d7ae9a2c Replace 'folder' with 'dir' 2013-04-08 21:13:59 +02:00
Stein Magnus Jodal
a221036e5a tests: Fix error message 2012-12-12 23:05:12 +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
6acaa490e9 Make all strings unicode by default (fixes #224) 2012-11-13 00:18:47 +01:00
Stein Magnus Jodal
ac60bcdf8e Fix all flake8 warnings in tests (#211) 2012-10-16 14:43:31 +02:00
Thomas Adamcik
5a47dfe159 Update import style in tests.utils.path 2012-09-16 22:44:15 +02:00
Thomas Adamcik
a707daf458 Add tests for expand_path and fix ordering.
Expansions need to happen before abspath is called or else result is wrong.
2012-09-16 22:26:44 +02:00
Thomas Adamcik
7ceb530064 Updated find files to ignore hidden files and folders. 2012-09-16 18:14:11 +02:00
Stein Magnus Jodal
8c2a333938 get_or_create_folder should also create intermediate folders 2012-02-09 23:12:40 +01:00
Thomas Adamcik
1985b4af76 Switch all tests over to from tests import unittest, which will be unittest2 on < 2.7 and plain unittest otherwise 2011-07-31 22:21:34 +02:00
Stein Magnus Jodal
79771d6e2c Rename data_folder() to path_to_data_dir() 2011-04-07 15:55:03 +02:00
Stein Magnus Jodal
c097af1a83 Fix a bunch of pylint errors/warnings in test suite 2011-01-23 18:39:05 +01:00
Thomas Adamcik
fe309d374e Get rid of all kinds of abspath and expandpath usage that is no longer needed 2010-11-01 00:37:55 +01:00
Thomas Adamcik
dd259d0797 Ensure that find_files only returns unicode 2010-10-30 23:12:32 +02:00
Thomas Adamcik
92333208de Add mopidy.utils.path.mtime helper that is easily faked in tests 2010-10-30 20:53:23 +02:00
Thomas Adamcik
d2d8e4c090 Use expanduser for find_files 2010-10-30 00:45:08 +02:00
Thomas Adamcik
a48e881040 Add split path util 2010-10-29 22:55:42 +02:00
Thomas Adamcik
d785b9b14e Added uri_to_path with tests 2010-10-29 22:16:33 +02:00
Thomas Adamcik
efc60a943b Update find files behaviour and add test for it 2010-10-26 00:08:51 +02:00
Stein Magnus Jodal
e4edd70c6d Split mopidy.utils into smaller pieces 2010-08-17 00:32:31 +02:00