def _createSendJob(user, filename, **controlinfo): """ Create a control file for a fax to be send. The control file is written to the same directory as the filename. NB: This function does not care about the control information to be written to the controlfile. This is to keep the definition of what is required for sending the fax out of here. It's up to the application layer to ensure correct parameters. """ controlfile = createDescriptionFor(filename, **controlinfo) fileutils._setProtection(user, 0600, filename, controlfile)
def createReceivedJob(user, filename, call_from, call_to, causes, **kwargs): """ Create a file description for a received fax. The description file is written to the same directory as the filename. """ controlinfo = { 'call_from': call_from, 'call_to': call_to, 'time': time.ctime(), 'cause': "0x%x/0x%x" % causes } controlinfo.update(kwargs) controlfile = createDescriptionFor(filename, **controlinfo) fileutils._setProtection(user, 0600, filename, controlfile)
def createReceivedJob(user, filename, call_from, call_to, causes): """ Create a file description for a received fax. The description file is written to the same directory as the filename. """ import time control = { 'call_from': call_from, 'call_to': call_to, 'date': time.ctime(), 'cause': "0x%x/0x%x" % causes, # we return this dict, thus set the filename here, too 'filename': filename, } controlfile = createDescriptionFor(**control) fileutils._setProtection(user, 0600, filename, controlfile) return control