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

feat: printer integration #359

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

jesicasusanto
Copy link
Collaborator

What kind of change does this PR introduce?

Summary

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • New and existing unit tests pass locally with my changes

How can your code be run and tested?

Other information

@abrichr
Copy link
Contributor

abrichr commented Jul 10, 2023

Ideally we would like to integrate this with signals #160

@cr-gpt
Copy link

cr-gpt bot commented Jul 12, 2023

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt
Copy link

cr-gpt bot commented Jul 12, 2023

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@cr-gpt
Copy link

cr-gpt bot commented Jul 12, 2023

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

subprocess.run(["lp", "-d", printer_name, file_path], capture_output=True)


# Get available printers
Copy link
Contributor

@abrichr abrichr Jul 14, 2023

Choose a reason for hiding this comment

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

Please move to tests.

Also please use @pytest.mark.skipif(!get_available_printers())

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed in 7e97f47

@jesicasusanto jesicasusanto marked this pull request as ready for review July 21, 2023 14:44
printer_name = printer.get_available_printers()[0]
file_path = os.path.join(current_dir, "resources", "test_print_document.pdf")
printer.print_document(printer_name, file_path)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please assert something about the result of printer_jobs = printer.get_printer_jobs(printer_name) here

import subprocess
import platform

def get_available_printers():
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please run black on this PR, and set up your pre-commit hooks as described in the README so it happens automatically in the future?

(There should be two newlines before a function definition)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed in e0a82e4

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.

None yet

2 participants