| 239 | |
| 240 | self.PrinterName = os.environ.get("PRINTER", "") |
| 241 | self.Directory = self.config.getPrinterDirectory(self.PrinterName) |
| 242 | self.Action = "ALLOW" # job allowed by default |
| 243 | self.Reason = None |
| 244 | self.JobId = sys.argv[1].strip() |
| 245 | # use CUPS' user when printing test pages from CUPS' web interface |
| 246 | self.UserName = sys.argv[2].strip() or self.originalUserName or pwd.getpwuid(os.geteuid())[0] |
| 247 | self.Title = sys.argv[3].strip() |
| 248 | self.Copies = int(sys.argv[4].strip()) |
| 249 | self.Options = sys.argv[5].strip() |
| 250 | if len(sys.argv) == 7 : |
| 251 | self.InputFile = sys.argv[6] # read job's datas from file |
| 252 | else : |
| 253 | self.InputFile = None # read job's datas from stdin |
| 254 | self.DataFile = os.path.join(self.Directory, "%s-%s-%s-%s" % \ |
| 255 | (self.myname, self.PrinterName, self.UserName, self.JobId)) |
| 256 | |
263 | | |
264 | | self.Action = "ALLOW" # job allowed by default |
265 | | self.Reason = None |
266 | | self.JobId = sys.argv[1].strip() |
267 | | # use CUPS' user when printing test pages from CUPS' web interface |
268 | | self.UserName = sys.argv[2].strip() or self.originalUserName or pwd.getpwuid(os.geteuid())[0] |
269 | | self.Title = sys.argv[3].strip() |
270 | | self.Copies = int(sys.argv[4].strip()) |
271 | | self.Options = sys.argv[5].strip() |
272 | | if len(sys.argv) == 7 : |
273 | | self.InputFile = sys.argv[6] # read job's datas from file |
274 | | else : |
275 | | self.InputFile = None # read job's datas from stdin |