diff --git a/autoradio-site.cfg b/autoradio-site.cfg index f405fde..7385d1f 100644 --- a/autoradio-site.cfg +++ b/autoradio-site.cfg @@ -22,7 +22,7 @@ minelab=180 # to adjust the programming you have to make changes minsched minutes before minsched=5 -locale="it_IT.UTF-8" +locale="C.UTF-8" user = autoradio group = autoradio diff --git a/autoradio.cfg b/autoradio.cfg index 05b0d36..70a1693 100644 --- a/autoradio.cfg +++ b/autoradio.cfg @@ -22,7 +22,7 @@ minelab=180 # to adjust the programming you have to make changes minsched minutes before minsched=5 -locale="it_IT.UTF-8" +locale="C.UTF-8" #user = pat1 #group = pat1 diff --git a/autoradio/__init__.py b/autoradio/__init__.py index 61b166e..3935908 100644 --- a/autoradio/__init__.py +++ b/autoradio/__init__.py @@ -1 +1 @@ -_version_="3.0" +_version_="3.1" diff --git a/autoradio/daemon.py b/autoradio/daemon.py index 07b0a1e..612d567 100644 --- a/autoradio/daemon.py +++ b/autoradio/daemon.py @@ -135,8 +135,8 @@ def openstreams(self): in the constructor. """ si = open(self.options.stdin, "r") - so = open(self.options.stdout, "a+") - se = open(self.options.stderr, "a+", 0) + so = open(self.options.stdout, "ab+") + se = open(self.options.stderr, "ab+", 0) os.dup2(si.fileno(), sys.stdin.fileno()) os.dup2(so.fileno(), sys.stdout.fileno()) os.dup2(se.fileno(), sys.stderr.fileno()) @@ -267,7 +267,7 @@ def start(self): # Write pid file (will belong to the new user) if self.options.pidfile is not None: - open(self.options.pidfile, "wb").write(str(os.getpid())) + open(self.options.pidfile, "w").write(str(os.getpid())) # Reopen file descriptors on SIGHUP signal.signal(signal.SIGHUP, self.handlesighup) @@ -283,7 +283,7 @@ def stop(self): if self.options.pidfile is None: sys.exit("no pidfile specified") try: - pidfile = open(self.options.pidfile, "rb") + pidfile = open(self.options.pidfile, "r") except IOError as exc: sys.exit("can't open pidfile %s: %s" % (self.options.pidfile, str(exc))) data = pidfile.read() diff --git a/autoradiod b/autoradiod index e399b65..7119da7 100755 --- a/autoradiod +++ b/autoradiod @@ -45,7 +45,10 @@ def main(): import logging,os,sys,errno,signal,logging.handlers import subprocess - import thread + try: + import thread + except: + import _thread as thread import datetime import time as timesleep #from threading import * @@ -150,7 +153,7 @@ def main(): type=schedule.type emission_done=schedule.emission_done - if ( emission_done <> None ): + if ( emission_done != None ): if ( type == "program" ): #la trasmissione ha una schedula con un'unica emissione prevista logging.debug( " %s %s %s schedula already done; ignore it !",type,scheduledatetime,emission_done)