Adding suffix methods and properties #198
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The suffix, suffixes properties and
with_name
,with_suffix
methods were added(names chosen to be similar to other packages, like the builtin
pathlib
). Onedifference vs. pathlib is an optional parameter for the
with_suffix
method thatallows simple manipulation of extended suffixes, like
.tar.gz
.These additions are useful for working with multiple files of the same name,
such as when compiling programs or documents, and for packing/changing
compressed files.
Documentation, local and remote (and base class) support, unittests, and an
example were added.
As a quick example, here is .tar.gz -> .zip conversion, adopted from the bash script at http://stackoverflow.com/questions/6301885/convert-tar-gz-to-zip :
And this would compile a tex file and remove the extra files generated: