Example #1
0
 def openlog(self, fname):
     from pycopia import logfile
     try:
         fp = logfile.open(fname, "w")
     except: # non fatal
         ex, val, tb = sys.exc_info()
         print >>sys.stderr, "Warning: could not open %r for writing: %s (%s)." % (fname, ex, val)
     else:
         self._FLIST.append(fp)
Example #2
0
 def openlog(self, fname):
     from pycopia import logfile
     try:
         fp = logfile.open(fname, "w")
     except: # non fatal
         ex, val, tb = sys.exc_info()
         print >>sys.stderr, "Warning: could not open %r for writing: %s (%s)." % (fname, ex, val)
     else:
         self._FLIST.append(fp)
Example #3
0
def startDurus(host, port, logfilename, dbfilename):
    """Start and initialize the Durus server component.

  Also opens a log file.
  """
    lf = logfile.open(logfilename, 50000)
    direct_output(lf)
    logger.setLevel(9)
    storage = FileStorage(dbfilename, repair=False, readonly=False)
    log(20, 'Storage file=%s host=%s port=%s', storage.get_filename(), host,
        port)
    StorageServer(storage, host=host, port=port).serve()
Example #4
0
def main(argv):
    global CF
    CF = basicconfig.get_config("/etc/pycopia/voicemail.conf")
    if CF.get("LOGFILE"):
        lf = logfile.open(CF.LOGFILE)
    else:
        lf = None

    rv = 1
    try:
        rv = answering_machine(lf)
    finally:
        if lf:
            lf.close()
    return rv
Example #5
0
def main(argv):
    global CF
    CF = basicconfig.get_config("/etc/pycopia/voicemail.conf")
    if CF.get("LOGFILE"):
        lf = logfile.open(CF.LOGFILE)
    else:
        lf = None

    rv = 1
    try:
        rv = answering_machine(lf)
    finally:
        if lf:
            lf.close()
    return rv
Example #6
0
def main(argv):
    cf = ConfigHolder()
    cf.VOICEDIR = "/var/spool/voice"
    cf.MESSAGEDIR = "messages"
    cf.SPOOLDIR = "incoming"
    cf.GREETING = "greeting.rmd"
    cf.LOGFILE = "/var/log/voicemail/voicemail.log"

    lf = logfile.open(cf.LOGFILE)

    try:
        rv = Vgetty.answering_machine(cf, lf)
    finally:
        lf.close()
    return rv
Example #7
0
def main(argv):
    cf = ConfigHolder()
    cf.VOICEDIR = "/var/spool/voice"
    cf.MESSAGEDIR = "messages"
    cf.SPOOLDIR = "incoming"
    cf.GREETING = "greeting.rmd"
    cf.LOGFILE = "/var/log/voicemail/voicemail.log"

    lf = logfile.open(cf.LOGFILE)

    try:
        rv = Vgetty.answering_machine(cf, lf)
    finally:
        lf.close()
    return rv