[contestms-dev] Re: Printing

  • From: Luca Wehrstedt <luca.wehrstedt@xxxxxxxxx>
  • To: contestms-dev@xxxxxxxxxxxxx
  • Date: Thu, 14 Nov 2013 00:28:54 +0100

I would write a Service. It makes it easier to manage the code and gives
more flexibility in setting up the system (particularly if non-network
printers are used, I guess). As I expect that each printing job needs some
data to be put in the database (because we need it to enforce constraints)
this data could contain also the status, in addition to the reference to
the submitting user, the digest of the file, the timestamp, etc. I know
nothing about CUPS's API for Python, but if it doesn't do strange things
then the gevent monkey-patching should make it non-blocking (unfortunately
one of these "strange things" is calling blocking functions of a C API). We
need to investigate this. (The backup plan is to use threads: one for each
available printer should be enough).

Luca


On Wed, Nov 13, 2013 at 5:16 PM, Fabian Gundlach
<fabian.gundlach@xxxxxxxxx>wrote:

> Hi,
>
> thanks for your comments!
>
> Would you recommend writing a separate Service for printing or just some
> functions that CWS can call directly? If we use a separate Service, how do
> we
> notify the user of errors (e.g. if he wants to print too many pages). If we
> call functions directly, will that block other connections?
>
> Best,
> Fabian
>
> > On Tue Nov 12 2013 at 10:25:30 AM, Luca Wehrstedt <
> luca.wehrstedt@xxxxxxxxx>
> > wrote:
> > > As all the IOIs I took part to weren't "paperless" I did never print
> > > anything and I don't know the needs of contestants on the matter. Yet I
> > > feel that being unable to print from the usual application dialog, but
> > > having to use it to produce a PDF to send via the web server instead,
> is
> > > an
> > > inconvenience of your proposal (the only one I found).
> >
> > It shouldn't be hard to implement a simple codec to translate text to pdf
> > for the contestant's convenience. After all, I can see only two types of
> > prints: task statements (already in pdf) and source code (unicode text).
> >
> > -- Ste
>
>

Other related posts: