-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Thu, Apr 02, 2020 at 01:57:39PM -0700, Jason Phan wrote: > Woohoo! The initial PR has been submitted (though there are some GPG issues > on my end). > > Besides the port to Python, some other notable features in the PR include > support for multiple PDF files and proper error handling for the qrexec > streams. > > There's a bit more to do but before I get started on that I have some more > questions (sorry): > > 1. Do I have to add a docstring for every function? I tried to name the > functions and > variables so that their type and usage would be self-explanatory, plus > it'd be a bit > redundant imo since quite a few of the functions take the same > parameters.
Yes, self-explanatory names should be enough for simple functions. But still, more complex functions, or with non-trivial arguments should have a docstring. > 2. How important is Windows compatibility here? I'm trying to replace as > many shell > commands as possible with pure Python but frankly some of them (e.g., > the ImageMagick > commands) don't have official alternatives and others for some reason > don't work > properly when implemented in Python (at least, with what I've tried so > far). Right now windows compatibility (especially on the server side) isn't that important. > 3. The server-side rendering is just screaming to be async-ified. Any > objections? Nothing specifically against. But also be careful about resources - for example rendering all the pages in parallel is a bad idea, since there may be many of them (and in fact we do have a test that tries to convert 500 pages PDF file). > 4. It'd be nice to make this program more generic for like .docx and stuff. > Thoughts? On the server (rendering) side that should be fine, it is "just" using a different tool to render the file. On the receiving side I'd save it to pdf in any case. For example docx with just images is pretty much useless. > 5. Right now I'm having all the files processed in the same DisposableVM, > should they > be in separate ones? I would imagine though that that would take quite > a bit of resources > if there were many files. On the other hand, using a single DisposableVM means one malicious PDF could access/modify other files you're trying to convert. IMO a better approach would be to use separate DisposableVMs, but _independently_ optimize their resource usage (for example you don't need the whole graphical stuff and most of other service just to convert PDF -> RGB). - -- Best Regards, Marek Marczykowski-Górecki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAl6Gfy0ACgkQ24/THMrX 1ywFxAf/VayFSMEQt7sNUutSfWJlfGDMlPExI2Qwh9FRIMtVeyDyiMu4407UfcgG 7JYX7CIyVxbI0lx1emcxFor9WFLfNF07WdnU6bhNDMgU44F/2gdfIj3Ka2w6INBc +Gxhh1Gw71nCuvrgiWDc+dhVxz0TNCTCyhTFGNYvtSBTFxDKszdsSUj03nW9gk/9 hdRnykWUhBUCiACtk2dfgr+EU6aWzI4TIFlIDA44m2Jg3eGhX3VWU05YNn4jW9Nr Ble7k4XZ8C/MVmK3MWFCMOsrkceVk9P+SXV4Upo7gYoANZtEg43SCh3qKX+V7B8L q5UUII+oRw6Bq6svi/OR6ivz+44rbA== =zWkV -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "qubes-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-devel/20200403001124.GC32019%40mail-itl.
