Commit graph

544 commits

Author SHA1 Message Date
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
Ethan Dalool
eef6bf5175 Add sentinel.py. 2020-02-11 17:06:42 -08:00
Ethan Dalool
2add4e4ec1 Add helper function september_now so you can skip the now() call.
Especially so outsiders don't have to write the long call
eternalseptember.september_string(eternalseptember.now(), ...) if
they don't have their own now function.
2020-02-11 17:06:35 -08:00
Ethan Dalool
beaa7a47e1 Rename this variable strftime -> strf. 2020-02-11 17:05:05 -08:00
Ethan Dalool
8a3e823a2e Update ifmain to my standard format. 2020-02-11 17:03:26 -08:00
Ethan Dalool
ba3dedd39a Bump to version 0.0.47. 2020-02-09 11:56:15 -08:00
Ethan Dalool
0e92201e06 Add getpermission.py. 2020-02-09 11:54:28 -08:00
Ethan Dalool
6691722e7c main should return args.func(args) value. 2020-02-08 17:19:54 -08:00
Ethan Dalool
90de78a57e Bump to version 0.0.46. 2020-02-07 15:15:07 -08:00
Ethan Dalool
87ab04abab Add support for parsers that can be used bare, no required args. 2020-02-07 12:33:46 -08:00
Ethan Dalool
abe73ae24d Add extract_table_column_map and reverse_table_column_map. 2020-02-06 20:18:42 -08:00
Ethan Dalool
593ff020dc Add docstring to hex_byte. 2020-02-06 20:18:09 -08:00
Ethan Dalool
6cac1d5a25 Show all missing columns when raising the missing error. 2020-02-06 20:17:49 -08:00
Ethan Dalool
8238481262 Fix == between two Extensions. 2020-02-06 11:52:18 -08:00
Ethan Dalool
a8ef6ca2c2 Bump to version 0.0.45. 2020-02-04 19:27:11 -08:00
Ethan Dalool
1707b40292 Add imagetools.py. 2020-02-04 19:26:12 -08:00
Ethan Dalool
98f716256c Bump to version 0.0.44. 2020-02-04 19:25:20 -08:00
Ethan Dalool
2dad632122 If one handle gets permissionerror, close other one before return. 2020-02-03 19:29:27 -08:00
Ethan Dalool
6a63454f62 Fix exclude_directories not being used because if yield_dirs. 2020-02-03 16:43:39 -08:00
Ethan Dalool
0cff7b8734 Fix directories yielded twice, once as current and once as child. 2020-02-01 16:20:40 -08:00
Ethan Dalool
0cb646fda0 Appease some flake8 linting. 2020-01-31 20:53:29 -08:00
Ethan Dalool
3ff49e1a44 Improve spinal performance with os.walk, sacrificing breadth first.
Previously, os.path.isdir was one of the biggest time sinks in spinal.
Switching from my custom code to os.walk, thanks to its use of scandir,
saves a lot of time. For searching my 2TB drive with a hot cache, time
shrank from 70s to 35s.
However, os.walk doesn't support breadth first search, so that's gone
unless I reimplement os.walk myself to support it.
2020-01-31 20:25:47 -08:00
Ethan Dalool
752c46512b Bump to version 0.0.43. 2020-01-30 23:21:29 -08:00
Ethan Dalool
0d6e5d4a13 Let subparser_betterhelp inspect parser for aliases. 2020-01-30 19:29:39 -08:00
Ethan Dalool
31048fc89a Add functools.wraps. 2020-01-30 19:01:31 -08:00
Ethan Dalool
22febf2ef7 Add docstring to add_previews. 2020-01-30 19:00:22 -08:00
Ethan Dalool
35e0527222 Improve these variable names for clarity. 2020-01-30 18:54:41 -08:00
Ethan Dalool
895a223359 Add docstring to docstring_preview. 2020-01-30 18:54:25 -08:00
Ethan Dalool
0ccd269cc2 Strip resultant preview, let the caller organize whitespace. 2020-01-30 18:51:43 -08:00
Ethan Dalool
73483838c9 Remove bespoke indent function. Honestly just use textwrap. 2020-01-30 18:48:10 -08:00
Ethan Dalool
dc64fc3c47 Move helpstrings to global constant. 2020-01-30 18:46:47 -08:00
Ethan Dalool
f599d7e394 Match Python glob's argument signature. 2020-01-28 17:40:30 -08:00
Ethan Dalool
2af2389b8d Add winglob.fnmatch. 2020-01-28 17:35:49 -08:00
Ethan Dalool
b88450b567 Add pathclass.Extension class to enrich extension operations.
I often found myself writing code like if a.extension == 'png' and
trying to remember if I'm supposed to compare against 'png' or '.png',
and then it would trip up on files like A.PNG because I forgot to
lower() it.

So this class handles all that for you. You can == against it and it
will use os.path.normcase to give you OS-appropriate case sens,
and == works whether you include the dot or not. Then you can use
ext.with_dot or ext.no_dot to get reliably dotted strings.
2020-01-27 21:33:09 -08:00
Ethan Dalool
b13f93c006 Rearrange and somewhat simplify passwordy main. 2020-01-21 17:46:25 -08:00
Ethan Dalool
e6350f05d0 Add function urandom_hex to passwordy. 2020-01-21 17:45:34 -08:00
Ethan Dalool
751ab5eaac Add method spawn that inherits force_sep.
I am considering some other instance attributes similar to force_sep.
And since these need to be carried over into newly spawned Paths,
I want to consolidate that into a single method so I don't have
to risk forgetting it on a new object.
2020-01-20 21:52:40 -08:00
Ethan Dalool
5e397b1928 Simplify normalize_sep. 2020-01-20 21:49:14 -08:00