-
Notifications
You must be signed in to change notification settings - Fork 14
Run the UI in process and replace (some) sh with Python #17
Conversation
Please note that this PR is full of duplicated code and should not be merged yet. |
Great, Demi! I really like how the Python port is coming!! Yes, please refactor to reduce the duplicated code! The original UI was as all nicely sorted into different files in object oriented form and looked amazing. I saw you removed the notification that pops up when a video stream is started. In the case of the of using a webcam, when we integrate with the Qubes Devices system tray it will create a notification anyway so that's no problem there. (Granted, it will be without the webcam/screen icon but we could easily add the functionality to have an icon for the Qubes Devices tray notification if we wanted to.) However, in the case of screen sharing there will simply be no notification as it won't integrate with the Qubes Devices system tray. Do you think that screen sharing should have a notification at the start or is a tray icon all the way through sufficient? So yes, all good but I would like to keep Qubes Video Companion very modular and and object oriented (all components of which we would |
Also, on your git commits it says they are "Unverified" in a yellow tag because you haven't uploaded your public PGP key to GitHub. We aren't relying on the GitHub infrastructure for any security I'm aware of that but perhaps you should upload it just so GitHub is happy. |
By the way, why did you implement a Also, in my UI component I added this fallback for Qubes R4.0 dom0 because it does not have the newest AyatanaAppIndicator3 fork but it still works the exact same way which you seemed to leave out: I must ask, why are you rewriting some of the code I've already written except all in one file (not exactly a great practice for maintainable code as I'm sure you know)? I know you said there is a lot of deduplication work to be done but in the case of the tray icon UI you implemented I've already done it in a nice class for you (if you want to drop the notifications UI then you could refactor it to not to have a base class). We want it all in one process, not all in one file. Please do refactor this code, thank you. (I'm very picky about code quality haha, Hope this doesn't sound too harsh or anything. It seems like you intended to do a full refactoring on the code anyway) The video receiver and GStreamer Python ports I like (but the receiver needs a full Python implementation of course). Nice job converting that |
I was never going to commit this because I decided to just make the I've been quite busy honestly so I haven't made much progress on the C program but I may make a push to get it done soon. |
I didn’t initially plan to do so, but I needed something so that I could stop hard-coding the resolution and frame rate. I had also forgotten that you had written the Python version.
That certainly needs to be fixed!
This started out as “how can I get this to work at all?”. I built it by editing
Indeed this code is bad ― see above for how it got that way. I should have marked this as a draft because it is nowhere near ready to be merged.
Being picky about code quality is a good thing. My main concern is proper installation. Python code usually lives under
|
Yes, that's certainly a good idea! It's just that we haven't had much Python code up until now so I figured how it was at the time was alright for now. @DemiMarie I want to add you to the list of maintainers in the README. I just need to know what PGP key fingerprint you want to be put there. It should be the same key you use for code signing in this repo, however, the one you used is "unverified" and upon searching you up on |
f3f4c6f
to
a8ed894
Compare
Running the UI in-process guarantees that a UI crash will stop the flow of video information. A UI crash that did not stop streaming would be a security risk. Python code is both more flexible and easier to secure than shell scripts. The new code uses a “Service” class to encapsulate the common code shared between both ‘qvc.Webcam’ and ‘qvc.ScreenShare’. Only per-service code needs to be separate.
The functionality of ‘Notification’ was simple enough that it could just be inlined into ‘Service’. That left ‘UserInterface’ with only ‘TrayIcon’ as a child class, so merge the two.
No change in behavior.
Update: the code is now in much better shape. A common Right now, the only piece of code that I would not consider production-quality is the Video4Linux2 format selection code in
|
|
All but one of these fixes are for the video sending component so it works in Qubes R4.0 dom0 (Fedora 25). This means support for Python 3.5.4 and GStreamer 1.10.5. We will be able to drop these fixes when Qubes R4.1 is released giving us a more up-to-date dom0. Note that even if ones webcam is in sys-usb, compatibility with dom0 would still be necessary for screen sharing the host screen. This will remain true until we have achieved GUIVM. Additionally, support an earlier version of qrexec-client-vm on the video receiving side on Qubes R4.0 AppVMs.
Hi Demi, thanks for waiting for on me to getting around to work on this! Amazing job on this code, it is bordering on immaculate! I just did some more cleanups, organizing some functionality into functions tending to some I also changed the way in which the Next, I changed a few things in the video sender component to make it compatible with the software in Qubes R4.0 dom0 (Fedora 25). That as well as just one tiny change for the video receiving component for Qubes R4.0 that was necessary or it would cease to work. I did unfortunately have to remove a bit of the optimization and function annotations you added to make this happen but we can add them straight back once Qubes R4.1 is released and R4.0 is deprecated. We could also create a branch for R4.0 compatibility if you want. It's important to note that the vast majority of Qubes users still run R4.0 (including myself) as it is the stable build so it's important that we continue to provide support for it. Personally, I've been thinking about switching to R4.1 but I'm unsure as to how stable it is as I do use Qubes OS daily for everything I do on the computer so it needs to be completely stable. Then, I updated (and improved) the And lastly, I restructured the whole project to put the video sending components into the |
I 100% agree. My plan was to (eventually) make this shell script here also use that
Sounds good, you went for a different regex approach for your parser whereas I want with a line-by-line parser. I considered using regex but it seemed easier (at least for me) to do a line-by-line approach then trying to put together a big regex. I also knew that a line-by-line parser would be much more extensible (should that be necessary) and orders of magnitude faster because regex is generally very slow. However, it's still technically a micro-optimization so it's not worth worrying about. Let's just leave it as is because as you say, this will be rewritten in C with |
I noticed in the |
It is not. |
Ready to merge? |
I did test the code on my system, but it might very well have not worked on older versions of Python. |
I momentarily thought this also affected newer versions of Python but after further inspection it was just an oddity with how I had the However, those fixes are still definitely necessary the older version of Python in |
That definitely makes sense! Time to go ahead and merge I guess. |
(not sure if you should do it for code-signing reasons) |
For review, would the standard merge commit method be best or a rebase merge? |
I suspect that merge commit is better here, as it preserves commit signatures. |
Running the UI in-process guarantees that a UI crash will stop the flow
of video information. A UI crash that did not stop streaming would be a
security risk. Python code is both more flexible and easier to secure
than shell scripts.