Freien Plattenplatz in eigene Variable, und eine Konstante fuer Gig.

This commit is contained in:
Stefan Bethke 2010-08-07 09:04:16 +00:00
parent 28f217b9e1
commit 4b00bad4c2

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# $Schlepperbande: src/tivomirror/tivomirror,v 1.30 2010/08/05 20:05:18 stb Exp $
# $Schlepperbande: src/tivomirror/tivomirror,v 1.31 2010/08/06 08:41:55 stb Exp $
#
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
# zu transkodieren.
@ -21,6 +21,8 @@ import re
host = "tivo.lassitu.de"
mak = "7194378159"
targetdir = "/mnt/safe/tivo"
gig = 1024.0 * 1024 * 1024
minfree = 10 * gig
arset = dict()
arset["Family Guy"] = 43
@ -193,9 +195,9 @@ def savetoc(toc):
curdir = os.getcwd()
os.chdir(tmp)
avail = getAvail(targetdir)
if avail < 1024*1024*1024:
print "%s: %.1fM available, at least 1024M needed, stopping" % \
(targetdir, avail / 1024.0 / 1024.0)
if avail < minfree:
print "%s: %.1fG available, at least %.1fG needed, stopping" % \
(targetdir, avail / gig, minfree / gig)
sys.exit(1)
downloaddb = anydbm.open(curdir + "/tivo/.downloads", "c")
print "*** Getting listing"