5dff2d446b
Add docstring and comments to give_theme_cookie.
2021-10-31 13:30:34 -07:00
bae4953097
Move give_theme_cookie to flasktools.
2021-10-30 17:29:28 -07:00
f267d55f9d
Use functools.wraps.
2021-10-30 17:29:01 -07:00
38de31f1e2
Let the wrapped mains take additional arguments.
...
Just in case the application wants to do so.
2021-10-30 17:27:05 -07:00
2756fb87e3
Add docstring for monkeypatch_requests.
2021-10-25 12:29:28 -07:00
ba6cb79529
If level is None, don't bother making the nullcontext.
2021-10-25 12:28:22 -07:00
c3c22270ee
Add earlybird_config.
2021-10-25 11:28:07 -07:00
6e315303de
Finally finally fix vlogging/operatornotify interplay?
...
I realized that vlogging.main_decorator shouldn't be using basic_config
in the first place because main decorator should always create a stderr
handler and I was just contorting the previous code to make that happen
via basic_config. So instead let's just add it ourselves.
2021-10-25 11:27:57 -07:00
414fc60f48
Reduce redundancy in get_level_by_argv with tryremove.
2021-10-25 10:57:30 -07:00
083b466d07
Alphabetize functions.
2021-10-24 23:38:23 -07:00
7d9489b5ae
Add snake_case alias get_logger, getLogger.
2021-10-24 23:34:08 -07:00
ea08e2399e
Fix root.handlers check which I accidentally removed.
2021-10-24 23:30:41 -07:00
b68ac864fa
Return a pathclass object from @property drive.
2021-10-24 00:16:33 -07:00
d082a0fbb5
Finally solve vlogging/opnot interplay by just setting NOTSET always.
2021-10-18 18:20:17 -07:00
d38c7c074e
Add mutables.py.
...
I might regret this!
2021-10-15 22:57:23 -07:00
4e4fcdb77f
Add httperrors.py.
...
I'm on the fence about whether I'll really migrate everything over
to use this, but it's been sitting on my computer for weeks and I
haven't decided to delete it yet, so let's go.
2021-10-15 21:35:46 -07:00
bcb6c7df19
Fix use of pathclass in overwrite.
2021-10-12 21:12:24 -07:00
a94de2adde
Add some docstrings, return annotations.
2021-10-10 12:06:54 -07:00
6edba068e5
Add global constant INTERNET_IP.
2021-10-10 12:02:09 -07:00
1a375e4964
Assert stdin exists for all interactive functions.
2021-10-10 00:42:18 -07:00
a4196f2b13
Add aliases assert_is_dir, assert_not_dir.
2021-10-10 00:31:43 -07:00
05586e7e79
Let is_directory be canonical function, but keep the aliases.
2021-10-10 00:31:25 -07:00
87fbede7d5
Add option log_return_value.
2021-10-09 17:56:31 -07:00
531424c8c1
Remove *args, force use of named arguments.
2021-10-09 17:55:52 -07:00
c87fc584da
Call vlogging.basic_config as part of main_decorator.
2021-10-09 17:48:35 -07:00
e826eeca2c
Add vlogging.basic_config.
2021-10-09 17:47:48 -07:00
5b6a1b4c9c
Use abstract base class to help the subclass know what to do.
2021-10-09 12:12:18 -07:00
8eefc4a095
Small docstring improvements.
2021-10-05 16:53:30 -07:00
0a1ab15637
Add convenient pathclass.read, write.
2021-10-04 17:19:20 -07:00
39d6140138
Move assert_not_deleted to worms.
2021-10-02 12:45:17 -07:00
129eb3f8aa
Rename make_json_response -> json_response.
2021-10-01 23:01:36 -07:00
aa1e2d5756
Add worms.py.
2021-10-01 22:35:38 -07:00
a3ddeb8e09
Improve needs_rewrite detection.
2021-09-30 16:20:12 -07:00
c1edd8fc33
Clarify variables.
2021-09-30 16:20:04 -07:00
e273eb22a5
Change hash header.
2021-09-24 18:32:07 -07:00
8801407f58
Add --warning level.
2021-09-23 22:49:22 -07:00
7021308c9e
Add call to coinitialize.
2021-09-23 22:49:19 -07:00
5f6d291729
Fix docstring wrapping.
2021-09-23 22:39:09 -07:00
3c82dc64e0
Don't write to streams when pythonw makes them None.
2021-09-23 22:37:55 -07:00
5a2eca486f
Remove backwards compat function output.
2021-09-23 22:37:39 -07:00
bebcd6c7f3
Fix docstring column wrapping.
2021-09-23 22:36:39 -07:00
cd1fce3211
Add aliases is_directory, is_folder -> is_dir.
2021-09-23 22:36:14 -07:00
446626f1ce
Add pathclass.glob, glob_many.
2021-09-23 22:36:01 -07:00
85ea9ec660
Add winglob.glob_many.
2021-09-23 22:34:34 -07:00
f10942fd3f
Remove __del__ because the order of del is not guaranteed.
...
Sometimes the streamhandler is garbage collected before the
loghandler, in which case this makes a bad error.
2021-09-23 22:34:02 -07:00
6c0233c239
Update downloady with better use of pathclass, vlogging.
2021-09-23 22:32:48 -07:00
ac8e83a11e
Reduce arguments for main_log_context. Deal with argv in main_dec.
2021-09-16 21:46:31 -07:00
d0d7cf2145
Replace in+remove with index+pop.
...
The code turns out to be longer with these duplicate try-except,
but they are different enough that I can't really condense it
at the moment.
2021-09-16 21:19:46 -07:00
b561fd24b5
Reduce indentation by returning early.
2021-09-16 21:17:36 -07:00
adc99d383e
Call strip on --subject text.
2021-09-16 17:37:38 -07:00
e0f37b986c
Use double backslash even in docstring.
2021-09-13 18:00:56 -07:00
79c4f59cf2
Fully rewrite passwordy.
2021-09-11 11:15:31 -07:00
3032ed135d
Replace prints with stderr.
2021-09-11 11:13:03 -07:00
8d0ba6b946
Set pipeable.stdout, stderr line='' default.
2021-09-11 11:12:38 -07:00
df6a52452a
Use argparse for fusker.
2021-09-11 11:12:00 -07:00
0416f0babf
Discourage writes to pathclass._absolute_path.
2021-09-09 17:30:46 -07:00
d37e6fdf0b
Add networktools.wait_for_internet.
2021-09-08 21:54:03 -07:00
0274b9d4a5
Move checkerboard_image to imagetools.
2021-09-05 01:35:46 -07:00
1c23fbef63
Move truthystring to stringtools.
2021-09-05 01:11:27 -07:00
bdab1331b8
Move cached_endpoint, required_fields to flasktools.
2021-09-03 12:44:00 -07:00
ccd3bf72c0
Add gentools.run.
2021-08-31 19:22:50 -07:00
8eed09c14b
Specifically state that the exception killed the log context.
2021-08-28 14:58:11 -07:00
51d9a5202a
Fix get_all_volumes for 64-bit python.
2021-08-24 22:34:09 -07:00
3d29322cc1
Split get_level_by_argv into own function.
...
To facilitate other uses of the opt-in flags besides just attaching
to the logger.
2021-08-23 22:42:30 -07:00
e2f4357b15
Add SILENT to get_level_by_name.
2021-08-23 22:41:07 -07:00
d3a1578cca
Add some type annotations to test the waters.
2021-08-22 20:48:34 -07:00
98ee6e82c6
Improve various docstrings.
2021-08-22 20:46:12 -07:00
81f81a6c24
Don't log exit status if --operatornotify/level wasn't passed.
2021-08-22 19:50:04 -07:00
9c880f2825
A few docstring improvements.
2021-08-21 15:20:11 -07:00
4c4fae62cf
Delete clipext.py.
2021-08-17 14:01:00 -07:00
8ce994a54b
Replace use of clipext with pipeable, split_lines=False.
2021-08-17 14:00:29 -07:00
cb5228fe0c
Add argument split_lines for when you just want the whole text.
...
Calling '\n'.join(pipeable.input()) is not great because in many
situations, you're splitting text and joining it back together again
for no reason. With this option, we can let the code do the right
thing, and use pipeable as a general-purpose inputter in
more situations.
2021-08-17 14:00:11 -07:00
db8c6e42e3
Add TypeError if arg is not a string.
2021-08-17 13:48:57 -07:00
f5e5db1908
Let hms use pipeable.input_many instead of go.
2021-08-17 13:46:47 -07:00
93605e2577
Split long useragent string.
2021-08-13 23:40:29 -07:00
6442e8e40c
Fix ctrlc_return1 to return the wrapped return value.
2021-08-13 23:40:29 -07:00
14dcbda9fd
Add networktools, though some ideas are still not implemented.
2021-08-13 23:40:28 -07:00
1d6f9eee10
Add niceprints.py.
2021-08-13 23:40:28 -07:00
72fdcb2b04
Clarify pipeable.input_many docstring.
2021-08-11 01:01:14 -07:00
cdf551f28a
Let glob_filenames, glob_directories be singular strings.
2021-08-11 01:01:02 -07:00
eddd7b3818
Remove set_level_by_argv.
2021-08-10 11:54:04 -07:00
61db9296c8
Improve some docstrings.
2021-08-10 11:53:55 -07:00
16d9b85e62
Various lint appeasements.
2021-08-10 11:37:01 -07:00
63251b979b
Describe Path parameters in docstring.
2021-08-09 16:27:33 -07:00
81782383a9
Use regular path.join when constructing glob patterns.
...
I don't like the idea of having an intermediate Path object that isn't
a real path.
2021-08-09 08:36:20 -07:00
41dd3eb0db
Clarify docstring reference to LogHandlerContext.
2021-08-09 08:35:12 -07:00
47e3a9d7d4
Add imagetools.pad_to_square.
2021-08-09 08:34:58 -07:00
c65743ec02
Use random.choices instead of random.choice in a loop.
2021-08-09 08:33:02 -07:00
13bf8e2e47
Improve Windows reserved name check by adding to pathclass.
2021-07-24 12:24:24 -07:00
a12bc59b17
Remove some old unnecessary globals.
2021-07-24 12:21:51 -07:00
7545433253
Improve some docstrings.
2021-07-04 15:45:00 -07:00
e9d450029d
Log the program's final return when using @main_decorator.
2021-07-04 15:44:50 -07:00
f18f0fd2df
Remove option log_exception, always log it under our logger.
...
This unifies the thought process so that everything is done via the
log lines, not these separate config variables. Caller can mute this
module if they want to. Also, it was previously appending directly
to the message but now we can have our logger's name on it so it's
more clear who's reporting what.
2021-07-04 15:42:57 -07:00
2971d7e4d6
Improve operatornotify module docstring.
2021-07-02 02:59:34 -07:00
26040d4372
Use vlogging.main_decorator.
2021-07-02 02:59:14 -07:00
4aed87b522
Fix downloady.is_special_file.
2021-07-01 15:50:57 -07:00
c709a28d08
Add operatornotify.main_decorator to reduce application boilerplate.
2021-06-21 22:02:43 -07:00
81d09ad3bc
Add vlogging.main_decorator to reduce application boilerplate.
2021-06-21 21:54:42 -07:00
9cd7713a6b
Replace call to basicConfig with own handler.
2021-06-21 21:53:36 -07:00
689b8f5718
Let rotate_by_exif return new exif with orientation=1.
2021-06-06 20:29:29 -07:00
663e65795a
Add flasktools.make_json_response.
2021-06-04 21:48:04 -07:00
ee8c4b7fd8
Add ensure_response_type decorator.
...
So that all further decorators or response-processors know they
have a Response object.
2021-06-04 21:26:23 -07:00
45da148493
Add globals REQUEST_TYPES, RESPONSE_TYPES.
2021-06-04 20:58:31 -07:00
68d12e4900
Pass _case_correct=True on trusted values to speed up walk.
2021-06-04 13:07:59 -07:00
b3e0b310c2
Include starting path in blacklist check but not whitelist.
2021-06-04 13:06:10 -07:00
1d555d20dc
Switch to image.getexif, official as of pillow 6.
2021-06-03 21:11:19 -07:00
a36c5ca478
Add stringtools.natural_sorter.
2021-05-30 21:35:21 -07:00
96a0e177e6
Move ORIENTATION_KEY to global.
2021-05-30 21:34:29 -07:00
db60b84ede
Don't bother with 1-element list, just do it right away.
2021-05-25 01:45:34 -07:00
4741946eda
Do None check before isinstance check.
2021-05-18 23:26:44 -07:00
2d8d51a4f1
Docstring updates for many functions.
2021-05-18 17:48:57 -07:00
375b00bfd5
Add dynamic chunk sizing to keep consistent progress bar pace.
2021-05-18 17:48:35 -07:00
e7798574b3
Rename argument fpobj -> path.
2021-05-18 17:45:25 -07:00
0d4349e942
Migrate scripts to main_level_by_argv.
2021-05-16 21:02:18 -07:00
03bcded66a
Add main_level_by_argv, the next iteration of set_level_by_argv.
...
I have realized that when passing log levels by argv, it's better
for them to go to the root logger instead of the module logger,
since that would not affect the logs that come from imported modules.
2021-05-16 21:02:04 -07:00
cb4cef9339
Allow --operatornotify-level to act as opt in without both flags.
2021-05-16 20:43:28 -07:00
bfb06d46c9
Add parameters force_hours, force_minutes.
2021-05-16 20:31:35 -07:00
a45c5908f0
Explain main_log_context *args.
2021-05-14 09:53:19 -07:00
c744135b21
Only reset the buffer if notify did not raise an exception.
2021-05-14 09:53:02 -07:00
f6ded0a879
Add sqlhelpers.executescript.
2021-05-08 18:26:43 -07:00
ea284c9199
Add hash_class passthrough argument.
2021-05-08 18:23:28 -07:00
313070754f
Add callback_post_file.
2021-05-08 09:39:48 -07:00
133225f77c
Add parens to dotdict repr.
2021-05-08 09:39:22 -07:00
65f766928c
Add 'written' to copy_file results dotdict.
2021-05-08 09:39:13 -07:00
9bdee227b3
Replace dotdict init by dict with init by kwargs.
2021-05-08 09:26:10 -07:00
450f42bca6
Add source to spinal returned dotdict.
...
Just in case you store the results and process them later, out of
order, etc.
2021-05-08 09:02:22 -07:00
14c9cb5212
Add SILENT as a module constant.
2021-05-08 09:00:48 -07:00
c34f875014
Add operatornotify.LogHandler, LogHandlerContext.
2021-05-07 20:03:56 -07:00
b871a083b1
Add vlogging.get_level_by_name.
2021-05-06 19:29:02 -07:00
9e0509ae17
Improve expressionmatch docstrings.
2021-05-05 19:18:37 -07:00
af5ec0b52e
Add argparse to eternalseptember.
2021-05-03 19:03:28 -07:00
fd296fdbb0
Replace call to pipeable.output with pipeable.stdout.
2021-05-03 18:57:04 -07:00
44271a56c4
Add argparse, betterhelp to bytestring.
2021-05-03 18:55:12 -07:00
12a0c81819
Add docstrings to Backoff class's methods.
2021-05-03 18:32:18 -07:00
60abcbc8e3
Move assignment of backoff.x to the base class.
2021-05-03 18:31:58 -07:00
7bfe0a48ef
Use regular __doc__ instead of own DOCSTRING variable.
...
So that help(operatornotify) works as expected.
2021-05-03 18:24:37 -07:00
d03c653b46
Add operatornotify.py.
2021-04-28 19:36:01 -07:00
6de9fb3eaf
Fix is_special_file handling of pathclass.
2021-04-28 19:29:18 -07:00
269fea9cb7
Fix special filenames being abspathed.
2021-04-25 20:20:43 -07:00
57e12faca9
Add flasktools.py.
2021-04-02 18:24:40 -07:00
6d6ae3bd5c
Add vlogging to downloady.
2021-03-10 16:37:07 -08:00
c1703357e8
Add main_fallback name to vlogging.getLogger.
2021-01-29 12:12:50 -08:00
80d66c4117
Alphabetize imports.
2021-01-29 12:12:50 -08:00
0cb90875bd
Use safeprint instead of always encoding to ascii.
2021-01-29 12:12:49 -08:00
d9e1e6bf7c
Add bytes_per_second to hash_file.
2021-01-29 12:12:49 -08:00
1d90086d96
Improve spinal.walk with glob_ arguments.
...
This saves the caller from having to filter the results, and saves
us from instantiating Path objects that we don't want. This improves
spinal's position as the one-stop-shop for file tree iteration.
2021-01-29 12:12:49 -08:00
c893a21e14
Improve consistency of callback_permission_denied, hash_progress.
2021-01-29 12:12:49 -08:00
2bb71c6ac2
Remove callback_exclusion.
2021-01-29 12:12:48 -08:00
0b7eda1e36
Use path.size instead of os.path.getsize.
2021-01-29 12:12:48 -08:00
262580ab41
Use vlogging instead of logging.
2021-01-29 12:12:48 -08:00
9070c5df82
Let hash_class be mandatory argument, return actual hasher object.
2021-01-29 12:12:42 -08:00
b41597ec71
Call callback_progress before the byte limiter sleeps.
2021-01-25 14:18:44 -08:00
51bbe54f2d
Improve winglob docstring.
...
Clarify that "right results" really means consistent with windows
behavior.
2021-01-25 02:45:07 -08:00
f7e81d4f7f
Add module docstring to pipeable.
2021-01-19 17:04:13 -08:00
32d8137201
Return dotdict instead of list from copy_file, copy_dir.
2021-01-18 12:12:27 -08:00
5c0482032d
Rename callback_v1 -> callback_progress_v1.
2021-01-18 12:04:43 -08:00
aa68744107
Replace duplicated docstring remarks with simple hints.
2021-01-18 01:34:27 -08:00
826c2f5e5d
Simplify this destination_file yielder.
2021-01-18 01:18:55 -08:00
acab8e0c78
Don't remove spaces from input string.
...
This was allowing inputs like "5 5" to equal 55.
2021-01-18 01:08:35 -08:00
8a0ed3d131
Add BytestringException, ParseError.
...
Allows for more granular catching on the caller side.
2021-01-18 01:07:08 -08:00
7be7c2c908
Improve clarity of limiter_or_none logic.
2021-01-18 00:54:30 -08:00
e0771afa77
Add input_many.
2021-01-14 02:47:44 -08:00
6666430ed8
Add small comment about stop_event.
2021-01-14 02:47:44 -08:00
ac6149094d
Add a few docstrings, remove getpermission.py.
2021-01-13 16:37:28 -08:00
3ef4b31c46
Print log warning when subparser has no docstring.
2021-01-13 16:11:45 -08:00
c4dd1605a5
Add passwordy.random_hex in addition to urandom_hex.
2021-01-05 20:41:22 -08:00
cde65ca8f9
Add imagetools.rotate_by_exif.
2021-01-05 20:41:03 -08:00
9f1ce3238e
Rename variable to day_of_month.
2021-01-04 02:40:48 -08:00
166ed18004
Add expiry seconds option to cacheclass.
2021-01-01 16:24:22 -08:00
593dfe5cb0
Add optional args_postprocessor.
2020-12-30 12:31:21 -08:00
f72c68bab2
Improve subproctools.quote.
2020-12-15 13:10:13 -08:00
f2456faf62
Convert line to string before sending it to stdout/stderr.
2020-12-08 23:42:13 -08:00
7969e38872
Remove trailing newlines from lines read from files.
...
The other forms of pipeable.input don't include trailing newlines,
so this makes read_files more consistent with the rest.
2020-12-07 20:23:14 -08:00
62b44be0d5
Print betterhelp to stderr, not stdout.
2020-12-07 20:09:36 -08:00
6873beb823
Rename output -> stdout, add stderr.
2020-12-07 20:08:39 -08:00
0a1a3a545e
Add interactive.py to supercede getpermission with more prompts.
...
Will delete getpermission at a later date.
2020-12-06 15:48:57 -08:00
60b6278876
Add subproctools.py.
2020-12-06 15:48:57 -08:00
3e1a24a2a6
Move touch.py out of voussoirkit, into voussoir/cmd.
...
Within voussoirkit, the solution for touching a single file is
pathclass.Path.touch.
2020-12-06 15:48:57 -08:00
4b1e396d9f
Add docstring to pipeable.input.
2020-12-06 15:48:57 -08:00
9340e172df
Remove unused builtin_input.
2020-12-06 15:48:57 -08:00
86f2186dd6
Move not in_pipe->list(lines) so it is inherent to multiline input.
2020-12-06 15:48:57 -08:00
051b783964
Remove support for input(arg=None).
...
If the caller doesn't want to specify an arg, they should be using go().
2020-12-06 15:48:57 -08:00
a0c7bd0258
Add docstring to pipeable.go.
2020-12-06 15:48:56 -08:00
8fe13e0f83
Rewrite touch.py with argparse, pipeable.
2020-12-06 15:48:46 -08:00
8ff596a95e
Add function is_glob.
2020-12-05 20:04:51 -08:00
bf2865077a
Fix to_base for 0.
...
Further proof that nobody is using this code.
2020-12-05 20:00:27 -08:00
f8c0d46c5e
Alphabetize these functions.
2020-12-05 15:07:04 -08:00
244691713d
Add constant WINDOWS_BADCHARS for use in other programs.
2020-12-05 15:06:27 -08:00
ebe009f2a2
Add assert_not_file, assert_not_directory to round it out.
2020-12-05 14:55:02 -08:00
44d9bd9913
Add assert_is_link, assert_not_link.
2020-12-05 14:51:51 -08:00
946f329e8c
Add helpful decorator ctrlc_return1.
2020-11-30 22:01:37 -08:00
10a447cd07
Add argument read_files so that arg may be a filepath.
2020-11-30 22:01:23 -08:00
1cf2209910
Add function excise.
2020-11-26 18:18:47 -08:00
2cb443cf6d
Rename variable s -> text.
2020-11-26 18:18:26 -08:00
adc4247efd
Add Backoff.current to get value without stepping forward.
2020-11-20 13:29:33 -08:00
5d83ed655d
Add module docstring.
2020-11-18 03:18:01 -08:00
29541d2570
Add stringtools.py, gentools.py.
2020-11-18 03:17:54 -08:00
Ethan Dalool
2cbb93386e
Improve binding of loud.
2020-11-09 16:31:19 -08:00
Ethan Dalool
03e5830133
Add some docstrings.
2020-11-09 11:04:40 -08:00
Ethan Dalool
63689e02c0
Fix result_generator hanging when the job generator produces nothing.
2020-11-09 11:03:08 -08:00