Commit graph

282 commits

Author SHA1 Message Date
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
96a6e62c14 Bump to version 0.0.54. 2020-09-22 01:55:56 -07:00
Ethan Dalool
ba88731ae2 Fix cwd. 2020-09-22 01:55:30 -07:00
Ethan Dalool
e6efa2adcf Bump to version 0.0.53. 2020-09-20 21:28:43 -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
3abd141d5d Bump to version 0.0.52. 2020-09-15 15:05:29 -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
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