Commit graph

355 commits

Author SHA1 Message Date
Ethan Dalool
27291df9ad Sort Pathclass by normcase instead of absolute path. 2020-09-02 08:52:13 -07:00
Ethan Dalool
53528741b2 Assert exists before trying to calculate size; explicit elif.
If you have a path that you expect to expect to be a file, it is
confusing to see the traceback where it attempts to listdir because
self.is_file failed and the else was to treat it as a dir.
I prefer this explicit exists check, and explicit dir check.
Yeah, potential for race conditions exists.
2020-08-28 17:31:31 -07:00
Ethan Dalool
8e7eeb9c3f Use code from cmd's sdate.py which is better. 2020-08-26 10:07:06 -07:00
Ethan Dalool
385a5cdd30 Bump to version 0.0.51. 2020-08-25 18:44:18 -07:00
Ethan Dalool
e23bd1131f Add support for path-mounted drives. 2020-08-25 18:43:39 -07:00
Ethan Dalool
03256e2a79 Split long parameter list onto lines. 2020-08-25 18:43:12 -07:00
Ethan Dalool
09437547f0 Fix handling of destination replacement when source is drive root. 2020-08-20 13:53:29 -07:00
Ethan Dalool
499c012194 Bump to version 0.0.50. 2020-08-20 11:40:21 -07:00
Ethan Dalool
c0736e8acb Add windrives.py. 2020-08-20 11:39:49 -07:00
Ethan Dalool
a14902d124 Fix can_use_bare incorrectly handling nargs=* arguments. 2020-08-20 11:39:04 -07:00
Ethan Dalool
3c8b76051f Remove unused import safeprint. 2020-07-29 17:55:20 -07:00
Ethan Dalool
54d15dd1a5 Bump to version 0.0.49. 2020-07-20 18:09:39 -07:00
Ethan Dalool
9b5c6732d8 Move kbps.py from cmd repository to voussoirkit. 2020-07-20 18:06:45 -07:00
Ethan Dalool
16b1d85dbd Add main function to hms.py. 2020-07-20 18:04:12 -07:00
Ethan Dalool
3a5e160504 Add Path.__lt__ so they are sortable. 2020-07-20 18:03:48 -07:00
Ethan Dalool
5412af7d90 Return touched filenames instead of printing them. 2020-07-16 21:31:16 -07:00
Ethan Dalool
453b2d2fb1 Fix pathclass.glob actually only looking at cwd.
In other news, don't ever trust anything I do.
2020-07-16 21:28:40 -07:00
Ethan Dalool
ff9895a390 Add method glob to get child items with a glob pattern. 2020-07-07 22:25:44 -07:00
Ethan Dalool
df02690361 Add touch.py. 2020-06-22 17:45:54 -07:00
Ethan Dalool
4fa8265be2 Bump to version 0.0.48. 2020-05-17 16:40:18 -07:00
Ethan Dalool
39c09be237 Add configlayers.py. 2020-04-03 17:07:51 -07:00
Ethan Dalool
fb61212395 Add some example calls to bytestring docstring. 2020-03-15 15:21:00 -07:00
Ethan Dalool
417c14a023 Let directories @size property work also.
I was hesitant at first because of course it can be slow to run,
but previously you'd have to have an if so that you know whether you've
got int or none corresponding to files and folders anyway, so I don't
think the caller-side complexity is increased at all, and saves me from
having to write this as a helper function outside the class.
Only for special cases like preparing to handle permissionerror
would you need to use your own function.
2020-03-12 18:18:59 -07:00
Ethan Dalool
081313d7ef Add pathclass.drive for convenient splitdrive. 2020-03-12 17:45:42 -07:00
Ethan Dalool
f090d7d83d Rename args -> argv. 2020-03-12 14:04:23 -07:00
Ethan Dalool
430002f914 Rename variables byte_value -> number, string -> unit_string. 2020-03-12 14:03:56 -07:00
Ethan Dalool
46487d7a31 Add periods to these exception messages. 2020-03-12 14:03:10 -07:00
Ethan Dalool
f897abce11 Simplify this regex, remove unnecessary capture group. 2020-03-12 14:02:25 -07:00
Ethan Dalool
9abf74cb9b Set decimal_places to 0 when result is in bytes.
So that you get "100 b" instead of "100.000 b".
2020-03-12 14:00:38 -07:00
Ethan Dalool
169c944c38 Add easy mains suitable for most simple use cases. 2020-03-10 22:40:12 -07:00
Ethan Dalool
6eb43fb69d Rename betterhelp decorator to single_betterhelp, organize funcs. 2020-03-10 22:34:53 -07:00
Ethan Dalool
0368bfe87c Fix DotDict instantiation when calling DD(some_dict). 2020-03-10 21:04:49 -07:00
Ethan Dalool
8245e31036 Don't show the _DotDict__default attribute in str. 2020-03-10 21:04:14 -07:00
Ethan Dalool
895ae3265d Add a small comment to dotdict. 2020-03-03 01:57:50 -08:00
Ethan Dalool
4a0c0f4b48 Rename clear_done_and_start_jobs to start.
Originally the long name was to make it super clear that by
starting the queue you are going to lose whatever is in pool.jobs.
But then _jobs became private so the end user shouldn't be
touching that anyway. So we're free to make the public interface
simpler and just call it start.
2020-03-03 01:57:32 -08:00
Ethan Dalool
22321162f4 Remove scrap comments. 2020-03-03 01:55:54 -08:00
Ethan Dalool
46e6e82fa0 Make running_count and unfinished_count @property. 2020-03-03 01:55:22 -08:00
Ethan Dalool
13f19719b2 Add Pathclass.touch. 2020-03-02 17:46:19 -08:00
Ethan Dalool
35eec077ed Add bencode.py. 2020-02-28 15:34:49 -08:00
Ethan Dalool
011e844d4d Compare os.path.getsize before even opening handles. 2020-02-25 13:10:25 -08:00
Ethan Dalool
64bcb8167c Indicate hash alg in quickid, but only md5 for now. 2020-02-25 13:10:02 -08:00
Ethan Dalool
ebf1c86a9f Rename equal -> equal_handle, quickid -> quickid_handle.
It's too easy to forget if the plain equal/quickid names refer
to functions that take path arguments or handle arguments.
2020-02-25 10:42:05 -08:00
Ethan Dalool
b0c33b8137 Nevermind about sqlparse, too slow for my taste at the moment.
This was adding about 100ms to my start times for Etiquette,
which is too high as I'm trying to make Etiquette more cli friendly.
2020-02-25 10:41:13 -08:00
Ethan Dalool
104fdf637c Oops, add missing import sys. 2020-02-25 10:39:30 -08:00
Ethan Dalool
c22bcd290f Add pathclass.assert_exists and assert_not_exists. 2020-02-19 16:22:22 -08:00
Ethan Dalool
e334396d56 Add dotdict.py. 2020-02-19 13:11:26 -08:00
Ethan Dalool
b66a89268b Use sqlparse to strip comments before finding columns. 2020-02-19 13:06:57 -08:00
Ethan Dalool
f7e314f392 Replace some % formatters with fstrings. 2020-02-18 00:42:33 -08:00
Ethan Dalool
7c0f3979a4 Add a parent SpinalException class. 2020-02-18 00:23:57 -08:00
Ethan Dalool
ef89ba67c2 Rename hash_file's callback to callback_progress. 2020-02-18 00:20:51 -08:00