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

Add command line options to enable and disable jobs #820

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

Conversation

Jamstah
Copy link
Contributor

@Jamstah Jamstah commented May 5, 2024

Closes #813

Copy link
Owner

@thp thp left a comment

Choose a reason for hiding this comment

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

Use f-strings instead of %-formatting.

Also, can this be added to the documentation somewhere?

job = self._find_job(self.urlwatch_config.enable)
if job is not None:
job.enabled = True
print('Enabled %r' % (job,))
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
print('Enabled %r' % (job,))
print(f'Enabled {job!r}')

job.enabled = True
print('Enabled %r' % (job,))
else:
print('Not found: %r' % (self.urlwatch_config.enable,))
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
print('Not found: %r' % (self.urlwatch_config.enable,))
print(f'Not found: {self.urlwatch_config.enable!r}')

job = self._find_job(self.urlwatch_config.disable)
if job is not None:
job.enabled = False
print('Disabled %r' % (job,))
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
print('Disabled %r' % (job,))
print(f'Disabled {job!r}')

job.enabled = False
print('Disabled %r' % (job,))
else:
print('Not found: %r' % (self.urlwatch_config.disable,))
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
print('Not found: %r' % (self.urlwatch_config.disable,))
print(f'Not found: {self.urlwatch_config.disable!r}')

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.

Enable/disable job from the command line
2 participants