Commit graph

520 commits

Author SHA1 Message Date
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
Ethan Dalool
cbf546ee69 Add level_by_argv level --silent. 2020-11-08 20:12:19 -08:00
Ethan Dalool
e3d9336383 Pull code out to separate function get_level_by_argv. 2020-11-08 20:12:05 -08:00
Ethan Dalool
1468f318f8 Handle sys.stdin, stdout are None under pythonw. 2020-11-05 22:00:36 -08:00
Ethan Dalool
2ec77f287b Add vlogging.py. 2020-11-02 23:18:53 -08:00
Ethan Dalool
d29501bae7 Having removed self.spawn(other), add back Path(other). 2020-11-02 23:18:19 -08:00
Ethan Dalool
426da9b52b Let listdir spawn children with _correct_case already set. 2020-10-28 14:56:52 -07:00
Ethan Dalool
adf7353ae6 Cache _case_correct property to cut down on fs calls. 2020-10-28 14:55:49 -07:00
Ethan Dalool
1364d66264 Let kbps return all three values always.
Instead of just the missing value.
2020-10-23 07:47:10 -07:00
Ethan Dalool
3347962438 Fix normalization of paths during blacklist check. 2020-10-23 07:46:29 -07:00
Ethan Dalool
5232ca81fc Fix dotdict being subscripted instead of dot. 2020-10-23 07:46:06 -07:00
Ethan Dalool
e3cc64c19c Remove useless const from argparse arg. 2020-10-23 07:45:31 -07:00
Ethan Dalool
c0e9870b91 Rewrite threadpool with persistent threads that pick up jobs. 2020-10-12 16:34:26 -07:00
Ethan Dalool
4e9b43be8b Big threadpool update. 2020-10-09 13:10:24 -07:00
Ethan Dalool
12175c23a7 Add lazychain.py. 2020-10-09 13:09:51 -07:00
Ethan Dalool
d56eea85e6 Fix punctuation of these statements. 2020-10-08 09:39:41 -07:00
Ethan Dalool
5147d7b988 Move nested function do_it out to _run. 2020-10-06 23:09:06 -07:00
Ethan Dalool
0202aeaca0 Add backoff.py. 2020-10-06 11:18:25 -07:00
Ethan Dalool
d37dbe40f8 Add base exception class DownloadyException. 2020-09-25 16:09:42 -07:00
Ethan Dalool
0613fd10e4 Use DotDict for the download plans. 2020-09-25 15:56:24 -07:00
Ethan Dalool
0948139883 Rename variable localname -> temp_localname within download_plan. 2020-09-25 15:50:59 -07:00
Ethan Dalool
3deb6270ba Add support for more special filenames like Windows's "con". 2020-09-25 15:43:36 -07:00
Ethan Dalool
677d8a251f Don't worry with .seek if we're doing a fulldownload plan. 2020-09-25 15:42:39 -07:00
Ethan Dalool
ade7d63231 Use voussoirkit safeprint instead of duplicate function. 2020-09-25 15:30:49 -07:00
Ethan Dalool
6b546b39df Split safeprint into separate functions to remove deep indents. 2020-09-25 15:30:00 -07:00
Ethan Dalool
025c8d51a3 Use pathclass.Path.makedirs. 2020-09-24 14:17:14 -07:00
Ethan Dalool
a05d34ea9e Add Path.makedirs. 2020-09-24 14:16:51 -07:00
Ethan Dalool
ba88731ae2 Fix cwd. 2020-09-22 01:55:30 -07:00
Ethan Dalool
342062dd99 Use pathclass.Path.open. 2020-09-20 18:25:12 -07:00
Ethan Dalool
c6d7450028 Add Path.open. 2020-09-20 17:31:28 -07:00
Ethan Dalool
dcf84dedf8 Escape single quotes by doubling them up. 2020-09-15 14:03:41 -07:00
Ethan Dalool
a2337346fb Add helpful pathclass.cwd function. 2020-09-12 10:15:14 -07:00
Ethan Dalool
5510d94054 Add docstrings to all functions. 2020-09-09 14:40:37 -07:00
Ethan Dalool
331de6eaec Replace chunk_size=None with CHUNK_SIZE.
The idea was that you could overwrite the module-level CHUNK_SIZE so
that all future quickids would use it as the default, but I don't like
the code clutter and anybody who wants to change the default should
write their own partial function if it's that important.
2020-09-09 14:39:30 -07:00
Ethan Dalool
d95d1c9533 Add matches_handle, matches_file. 2020-09-09 14:34:50 -07:00
Ethan Dalool
d924e273b9 Let quickid functions take pathclass paths as arguments. 2020-09-09 14:34:08 -07:00
Ethan Dalool
52afa2489a Let quickid use any of hashlib.algorithms_guaranteed. 2020-09-09 14:33:45 -07:00
Ethan Dalool
7052b2c432 Fix __str__ in case self.token is not a string. 2020-09-09 12:55:09 -07:00
Ethan Dalool
bab1c2bffc Add callback_pre_directory, callback_pre_file.
These callbacks lets you inspect the anticipated copy operation before
it actually occurs. My particular motivation for adding this was to
search for source files which have been renamed, so I can rename the
matching destination file before it attempts to make a duplicate.
With the addition of the BAIL sentinel, you could also use this to
dynamically decide which dirs to skip, if the exclude_ sets are not
good enough for you.
2020-09-06 11:23:49 -07:00
Ethan Dalool
9ef8254191 Let walk_generator follow links, add skip_symlinks to copy_dir. 2020-09-06 11:17:30 -07:00
Ethan Dalool
5e5f55cf1f Remove "Default" from docstrings.
These are already visible with help(), and are cluttering the page.
2020-09-06 11:13:44 -07:00
Ethan Dalool
7840d53212 Move source.correct_case out of conditional.
The reasoning was that in the non-new_root case, the destination supplied
by the user would either be the exact path of the new file, or the parent
of the new file. Either way, the casing of source shouldn't matter since
only the file itself is being created with the given casing.

But, I realized, since we are doing makedirs in the event that the whole
path leading up to destination doesn't exist, we should create it with
the correct case according to the source. And that can occur regardless
of new_root.
2020-09-06 09:54:28 -07:00
Ethan Dalool
26eaac7119 Simplify this call to makedirs with destination.parent. 2020-09-06 09:32:12 -07:00
Ethan Dalool
b34f6fafed Rename callback_file -> callback_file_progress. 2020-09-05 21:21:56 -07:00
Ethan Dalool
36c7b5447f Rename callback_directory -> callback_directory_progress. 2020-09-05 21:21:38 -07:00
Ethan Dalool
9874f12a2a Return self from correct_case instead of self.absolute_path. 2020-09-02 09:11:49 -07:00
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
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
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
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
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
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
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
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
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
1707b40292 Add imagetools.py. 2020-02-04 19:26:12 -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
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
Ethan Dalool
af1538a139 Tighten the regex for bare drives. 2020-01-20 21:29:33 -08:00
Ethan Dalool
b4d3ac87de Avoid winshell import error for linux. 2020-01-19 21:00:16 -08:00
Ethan Dalool
adaa65a9a7 Lowercase before checking .lnk extension. 2020-01-15 22:35:29 -08:00
Ethan Dalool
75b95f0259 Add winwhich.py. 2020-01-11 01:39:20 -08:00
Ethan Dalool
e3f080b74f Update winglob module docstring. 2020-01-11 01:37:33 -08:00
Ethan Dalool
efbc1c44bb Add hms.py. 2020-01-06 22:18:50 -08:00
Ethan Dalool
b0b0464fdc Add winglob.py. 2020-01-05 23:28:53 -08:00
Ethan Dalool
6faab40fb2 Let chunk_size be an argument to override global default. 2020-01-05 21:31:19 -08:00
Ethan Dalool
c33d16bff0 Replace calls to str_to_fp with pathclass.Path. 2020-01-05 21:29:27 -08:00
Ethan Dalool
76abee4607 Add newline to passwordy. 2020-01-05 21:24:43 -08:00
Ethan Dalool
07da8dd413 Add betterhelp.py 2019-08-06 23:42:04 -07:00
Ethan Dalool
b0ed32a1d5 Add Path.dot_extension property. 2019-08-05 17:34:17 -07:00
Ethan Dalool
452ad7f937 Add force_sep attribute. 2019-08-03 01:01:00 -07:00
Ethan Dalool
85572ba406 Add parameter simple to remove .\ from relative path. 2019-08-01 08:58:13 -07:00
Ethan Dalool
d9d10a843e Fix relative backsteps. 2019-08-01 08:57:18 -07:00
Ethan Dalool
6a34c8eae9 Add method Path.add_extension. 2019-08-01 08:47:27 -07:00
Ethan Dalool
b8aaecd15f Move case correction to after self==other check. 2019-08-01 08:47:04 -07:00
Ethan Dalool
e478aca497 Improve Path.__contains__ check. 2019-08-01 08:46:37 -07:00
Ethan Dalool
8ad50ca714 Add pipeable to voussoirkit. 2019-06-11 22:45:04 -07:00
Ethan Dalool
d71fc60862 Fix a bug in pathclass.Path.relative_path when cwd is root. 2019-02-17 23:43:33 -08:00
Ethan Dalool
2e5a71c765 Define listify seperately so you can call with any iterable.
The literal function will still be a bit more strict on the types
it accepts, but if you have something that you know is okay
to iterate you can call listify directly.
2019-01-01 18:01:37 -08:00
Ethan Dalool
fb2de5746c Add function sqlhelpers.literal. 2019-01-01 17:43:56 -08:00
Ethan Dalool
b4b51e3604 Initial migratory commit. 2018-12-17 22:10:00 -08:00