Beispiel #1
0
def cancelJob(jobid, dest=None):
    setPasswordPrompt("You do not have permission to cancel a job.")
    if dest is not None:
        return cupsext.cancelJob(dest, jobid)
    else:
        jobs = cupsext.getJobs(0, 0)
        for j in jobs:
            if j.id == jobid:
                return cupsext.cancelJob(j.dest, jobid)

    return False
Beispiel #2
0
def cancelJob(jobid, dest=None):
    setPasswordPrompt("You do not have permission to cancel a job.")
    if dest is not None:
        return cupsext.cancelJob(dest, jobid)
    else:
        jobs = cupsext.getJobs(0, 0)
        for j in jobs:
            if j.id == jobid:
                return cupsext.cancelJob(j.dest, jobid)

    return False
Beispiel #3
0
 def GetJobs(cls, completed=False, cups=None):
   """Get a list of jobs for the cups server.
   
   Args:
      completed: (boolean) True = Get completed jobs, False = Get pending jobs
      cups: (cups.Connection) cups connection for metadata lookup
   Returns:
      list of Job instances
   """
   return [cls.GetFromCUPS(x, cups=cups)
           for x in cupsext.getJobs(0, int(completed))]
Beispiel #4
0
def getAllJobs(my_job=0):
    return cupsext.getJobs(my_job, 0) + cupsext.getJobs(my_job, 1)
Beispiel #5
0
def getJobs(my_job=0, completed=0):
    return cupsext.getJobs(my_job, completed)
Beispiel #6
0
def getAllJobs(my_job=0):
    return cupsext.getJobs(my_job, 0) + cupsext.getJobs(my_job, 1)
Beispiel #7
0
def getJobs(my_job=0, completed=0):
    return cupsext.getJobs(my_job, completed)