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 config to do desktop notifications by running an abitrary command. #15013

Merged
merged 1 commit into from
Jan 13, 2017

Conversation

SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Jan 13, 2017

I now have an usual setup where I use a (fast) remote machine for building, and I’m adding a hack to forward end-of-build notifications back to my laptop. This is the motivation for this change, but I kept it general enough that it could be used in other situations.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

def notify_with_command(command):
def notify(title, text):
import subprocess
subprocess.check_call([command, title, text])
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be replaced with the call wrapper imported from command_base

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@cbrewster cbrewster added the S-awaiting-review There is new code that needs to be reviewed. label Jan 13, 2017


def notify(title, text):
def notify(config, title, text):
"""Generate a desktop notification using appropriate means on
supported platforms Linux, Windows, and Mac OS. On unsupported
platforms, this function acts as a no-op."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update this to say that we can also add a custom command to the config for generating a notification.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@emilio
Copy link
Member

emilio commented Jan 13, 2017

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 5168a69 has been approved by emilio

@highfive highfive assigned emilio and unassigned wafflespeanut Jan 13, 2017
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jan 13, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 5168a69 with merge 45a9981...

bors-servo pushed a commit that referenced this pull request Jan 13, 2017
Add config to do desktop notifications by running an abitrary command.

<!-- Please describe your changes on the following line: -->

I now have an usual setup where I use a (fast) remote machine for building, and I’m adding a hack to forward end-of-build notifications back to my laptop. This is the motivation for this change, but I kept it general enough that it could be used in other situations.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15013)
<!-- Reviewable:end -->
@emilio
Copy link
Member

emilio commented Jan 13, 2017

SimonSapin: r=me, though maybe you want to address waffles's comment about call?

Please address it if you don't mind. If you feel there's a good reason to not do that change, feel free to r=me after commenting on why.

@bors-servo r-

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 13, 2017
@SimonSapin
Copy link
Member Author

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

📌 Commit 16d8c35 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jan 13, 2017
@bors-servo
Copy link
Contributor

⌛ Testing commit 16d8c35 with merge 414e2e9...

bors-servo pushed a commit that referenced this pull request Jan 13, 2017
Add config to do desktop notifications by running an abitrary command.

<!-- Please describe your changes on the following line: -->

I now have an usual setup where I use a (fast) remote machine for building, and I’m adding a hack to forward end-of-build notifications back to my laptop. This is the motivation for this change, but I kept it general enough that it could be used in other situations.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15013)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

@bors-servo bors-servo merged commit 16d8c35 into master Jan 13, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 13, 2017
@Ms2ger Ms2ger deleted the notify-command branch January 18, 2017 09:54
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.

6 participants