Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single file processing #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

borondics
Copy link
Member

Issue
Description of changes

I added a feature to be able to process a single file as well, not only a directory.

@@ -20,8 +33,8 @@ def tinify_images(path, extensions):
parser.add_argument('-k', '--key', type=str, required=True,
help='API key')

parser.add_argument('-p', '--path', type=str, required=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't change existing argument names. Old saved commands should still work.

source = tinify.from_file(file_path)
source.to_file(file_path)
time.sleep(0.1)
elif os.path.isfile(target):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test this or previous solution depending on how it works with paths that have to expanded, such as ~/dev/orange3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants