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
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))]
def getAllJobs(my_job=0): return cupsext.getJobs(my_job, 0) + cupsext.getJobs(my_job, 1)
def getJobs(my_job=0, completed=0): return cupsext.getJobs(my_job, completed)