Commit graph

331 commits

Author SHA1 Message Date
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
Ethan Dalool
edd2ee716b Split file hashing code into own function hash_file. 2020-02-18 00:17:38 -08:00
Ethan Dalool
1976ccb843 Let known_size checking of verify_hash be optional. 2020-02-18 00:09:15 -08:00
Ethan Dalool
df9b829346 Replace some % formatters with fstrings. 2020-02-18 00:06:26 -08:00
Ethan Dalool
807470b9a2 Remove spinal.is_subfolder function. Pathclass has in operator. 2020-02-17 23:50:05 -08:00
Ethan Dalool
7713e735cc Remove the version number from bytestring.
It used to be a separate module, now it's in voussoirkit.
2020-02-17 23:42:07 -08:00
Ethan Dalool
d3d4eae8f6 Improve ratelimiter docstrings. 2020-02-17 23:40:42 -08:00
Ethan Dalool
941b9b5350 Add a lock to make Ratelimiter thread-safe. 2020-02-17 23:39:43 -08:00
Ethan Dalool
9b8b0b6339 Replace else-if with elif. 2020-02-17 23:08:35 -08:00
Ethan Dalool
1d0f96a966 Fix typo succesful -> successful. 2020-02-17 23:01:15 -08:00
Ethan Dalool
e5b07cd72d Add some comments to pipeable. 2020-02-17 22:58:26 -08:00
Ethan Dalool
560b918815 Remove this unused argv function. 2020-02-17 22:57:20 -08:00
Ethan Dalool
267ae16c5d Add a parent PipeableException class. 2020-02-17 22:56:39 -08:00
Ethan Dalool
eb3698637f Use SystemExit instead of sys.exit, like my other programs. 2020-02-17 22:56:19 -08:00
Ethan Dalool
4890129360 Add argument stop_event to safely finish & quit a copy thread. 2020-02-15 18:00:09 -08:00
Ethan Dalool
64d0968040 Use with statement for _job_manager_lock. 2020-02-12 19:17:49 -08:00
Ethan Dalool
f6872e77cf Make job._joinme_lock private to discourage outside editing. 2020-02-12 19:12:12 -08:00
Ethan Dalool
bf5d621dd3 Make pool._job_manager_lock private to discourage outside editing. 2020-02-12 19:11:55 -08:00
Ethan Dalool
7041448c82 Make pool._jobs private to discourage outside editing. 2020-02-12 19:11:24 -08:00
Ethan Dalool
1921e62011 Add method add_many for batch creation of jobs. 2020-02-12 19:06:20 -08:00
Ethan Dalool
7de2833df9 Make the job's thread private and toss it after it's done. 2020-02-12 17:30:23 -08:00
Ethan Dalool
b7a2c3b19b Simplify pool.join logic by just calling each job's join. 2020-02-12 17:29:29 -08:00
Ethan Dalool
a1f26200fa Add the ability to pause the threadpool. 2020-02-12 16:56:07 -08:00
Ethan Dalool
630159768d Use slice assignment instead of list.remove for clearing jobs. 2020-02-12 16:53:52 -08:00
Ethan Dalool
87a3002351 Add threadpool.py. 2020-02-11 17:07:00 -08:00