[Pkg-owncloud-commits] [php-sabredav] 56/148: tfix: threshold

David Prévot taffit at moszumanska.debian.org
Wed Apr 15 01:37:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit f790d3fd6252b659e579d24fa022778cbe244aeb
Author: David Prévot <taffit at debian.org>
Date:   Thu Feb 26 13:40:12 2015 -0400

    tfix: threshold
---
 bin/naturalselection | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/bin/naturalselection b/bin/naturalselection
index aa5554d..8cf73b6 100755
--- a/bin/naturalselection
+++ b/bin/naturalselection
@@ -16,16 +16,16 @@ def getfreespace(path):
     stat = os.statvfs(path)
     return stat.f_frsize * stat.f_bavail
 
-def getbytesleft(path,treshold):
-    return getfreespace(path)-treshold
+def getbytesleft(path,threshold):
+    return getfreespace(path)-threshold
 
-def run(cacheDir, treshold, sleep=5, simulate=False, min_erase = 0):
+def run(cacheDir, threshold, sleep=5, simulate=False, min_erase = 0):
 
-    bytes = getbytesleft(cacheDir,treshold)
+    bytes = getbytesleft(cacheDir,threshold)
     if (bytes>0):
-        print "Bytes to go before we hit treshhold:", bytes
+        print "Bytes to go before we hit threshold:", bytes
     else:
-        print "Treshold exceeded with:", -bytes, "bytes"
+        print "Threshold exceeded with:", -bytes, "bytes"
         dir = os.listdir(cacheDir)
         dir2 = []
         for file in dir:
@@ -46,7 +46,7 @@ def run(cacheDir, treshold, sleep=5, simulate=False, min_erase = 0):
         left = min_erase
 
         # If the min_erase setting is lower than the amount of bytes over
-        # the treshold, we use that number instead.
+        # the threshold, we use that number instead.
         if left < -bytes :
             left = -bytes
 
@@ -73,7 +73,7 @@ def run(cacheDir, treshold, sleep=5, simulate=False, min_erase = 0):
 def main():
     parser = OptionParser(
         version="naturalselecton v0.3",
-        description="Cache directory manager. Deletes cache entries based on accesstime and free space tresholds.\n" +
+        description="Cache directory manager. Deletes cache entries based on accesstime and free space thresholds.\n" +
             "This utility is distributed alongside SabreDAV.",
         usage="usage: %prog [options] cacheDirectory",
     )
@@ -98,15 +98,15 @@ def main():
         default=5
     )
     parser.add_option(
-        '-l','--treshold',
-        help="Treshhold in bytes (default = 10737418240, which is 10GB)",
+        '-l','--threshold',
+        help="Threshold in bytes (default = 10737418240, which is 10GB)",
         type="int",
-        dest="treshold",
+        dest="threshold",
         default=10737418240
     )
     parser.add_option(
         '-m', '--min-erase',
-        help="Minimum number of bytes to erase when the treshold is reached. " +
+        help="Minimum number of bytes to erase when the threshold is reached. " +
             "Setting this option higher will reduce the amount of times the cache directory will need to be scanned. " +
             "(the default is 1073741824, which is 1GB.)",
         type="int",
@@ -130,7 +130,7 @@ def main():
             cacheDir,
             sleep=options.sleep,
             simulate=options.simulate,
-            treshold=options.treshold,
+            threshold=options.threshold,
             min_erase=options.min_erase
         )
         if runs>0:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list