Private GIT

Skip to content
Snippets Groups Projects
Commit 3eedabf3 authored by Jonathon Saine's avatar Jonathon Saine
Browse files

Require Python 2.5 or higher

PEP8 fixes (whitespace readability)
parent ddc175ff
Branches
Tags
No related merge requests found
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>. # along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
import sys import sys
if sys.version_info < (2, 5):
print "Sorry, requires Python 2.5 or higher."
sys.exit(1)
# we only need this for compiling an EXE and I will just always do that on 2.6+ # we only need this for compiling an EXE and I will just always do that on 2.6+
if sys.hexversion >= 0x020600F0: if sys.hexversion >= 0x020600F0:
...@@ -45,6 +48,7 @@ from lib.configobj import ConfigObj ...@@ -45,6 +48,7 @@ from lib.configobj import ConfigObj
signal.signal(signal.SIGINT, sickbeard.sig_handler) signal.signal(signal.SIGINT, sickbeard.sig_handler)
signal.signal(signal.SIGTERM, sickbeard.sig_handler) signal.signal(signal.SIGTERM, sickbeard.sig_handler)
def loadShowsFromDB(): def loadShowsFromDB():
""" """
Populates the showList with shows from the database Populates the showList with shows from the database
...@@ -63,6 +67,7 @@ def loadShowsFromDB(): ...@@ -63,6 +67,7 @@ def loadShowsFromDB():
#TODO: make it update the existing shows if the showlist has something in it #TODO: make it update the existing shows if the showlist has something in it
def daemonize(): def daemonize():
""" """
Fork off as a daemon Fork off as a daemon
...@@ -89,7 +94,7 @@ def daemonize(): ...@@ -89,7 +94,7 @@ def daemonize():
if pid != 0: if pid != 0:
sys.exit(0) sys.exit(0)
except OSError, e: except OSError, e:
raise RuntimeError("2st fork failed: %s [%d]" % raise RuntimeError("2nd fork failed: %s [%d]" %
(e.strerror, e.errno)) (e.strerror, e.errno))
dev_null = file('/dev/null', 'r') dev_null = file('/dev/null', 'r')
...@@ -100,6 +105,7 @@ def daemonize(): ...@@ -100,6 +105,7 @@ def daemonize():
logger.log(u"Writing PID " + pid + " to " + str(sickbeard.PIDFILE)) logger.log(u"Writing PID " + pid + " to " + str(sickbeard.PIDFILE))
file(sickbeard.PIDFILE, 'w').write("%s\n" % pid) file(sickbeard.PIDFILE, 'w').write("%s\n" % pid)
def main(): def main():
""" """
TV for me TV for me
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment