Skip to content

Commit

Permalink
bug on debian install (default locale) and python3 refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 30, 2018
1 parent ae14a09 commit f94ff18
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion autoradio-site.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion autoradio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion autoradio/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_version_="3.0"
_version_="3.1"
8 changes: 4 additions & 4 deletions autoradio/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down
7 changes: 5 additions & 2 deletions autoradiod
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f94ff18

Please sign in to comment.