summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup
diff options
context:
space:
mode:
Diffstat (limited to 'rdiff-backup/rdiff_backup')
-rw-r--r--rdiff-backup/rdiff_backup/Globals.py3
-rw-r--r--rdiff-backup/rdiff_backup/Main.py9
-rw-r--r--rdiff-backup/rdiff_backup/Time.py20
3 files changed, 3 insertions, 29 deletions
diff --git a/rdiff-backup/rdiff_backup/Globals.py b/rdiff-backup/rdiff_backup/Globals.py
index f472512..b9045f7 100644
--- a/rdiff-backup/rdiff_backup/Globals.py
+++ b/rdiff-backup/rdiff_backup/Globals.py
@@ -156,9 +156,6 @@ select_mirror = None
# object. Access is provided to increment error counts.
ITRB = None
-# Percentage of time to spend sleeping. None means never sleep.
-sleep_ratio = None
-
# security_level has 4 values and controls which requests from remote
# systems will be honored. "all" means anything goes. "read-only"
# means that the requests must not write to disk. "update-only" means
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py
index 27ef56c..c511c26 100644
--- a/rdiff-backup/rdiff_backup/Main.py
+++ b/rdiff-backup/rdiff_backup/Main.py
@@ -57,10 +57,9 @@ def parse_cmdlineoptions(arglist):
"parsable-output", "print-statistics", "quoting-char=",
"remote-cmd=", "remote-schema=", "remove-older-than=",
"restore-as-of=", "restrict=", "restrict-read-only=",
- "restrict-update-only=", "server", "sleep-ratio=",
- "ssh-no-compression", "terminal-verbosity=", "test-server",
- "verbosity=", "version", "windows-mode",
- "windows-time-format"])
+ "restrict-update-only=", "server", "ssh-no-compression",
+ "terminal-verbosity=", "test-server", "verbosity=",
+ "version", "windows-mode", "windows-time-format"])
except getopt.error, e:
commandline_error("Bad commandline options: %s" % str(e))
@@ -133,8 +132,6 @@ def parse_cmdlineoptions(arglist):
elif opt == "-s" or opt == "--server":
action = "server"
Globals.server = 1
- elif opt == "--sleep-ratio":
- Globals.set_float("sleep_ratio", arg, 0, 1, inclusive=0)
elif opt == "--ssh-no-compression":
Globals.set('ssh_compression', None)
elif opt == "--terminal-verbosity": Log.setterm_verbosity(arg)
diff --git a/rdiff-backup/rdiff_backup/Time.py b/rdiff-backup/rdiff_backup/Time.py
index 1b2975e..289df0a 100644
--- a/rdiff-backup/rdiff_backup/Time.py
+++ b/rdiff-backup/rdiff_backup/Time.py
@@ -34,7 +34,6 @@ _genstr_date_regexp1 = re.compile("^(?P<year>[0-9]{4})[-/]"
_genstr_date_regexp2 = re.compile("^(?P<month>[0-9]{1,2})[-/]"
"(?P<day>[0-9]{1,2})[-/](?P<year>[0-9]{4})$")
curtime = curtimestr = None
-been_awake_since = None # stores last time sleep() was run
def setcurtime(curtime = None):
"""Sets the current time in curtime and curtimestr on all systems"""
@@ -175,25 +174,6 @@ def cmp(time1, time2):
elif time1 == time2: return 0
else: return 1
-
-def sleep(sleep_ratio):
- """Sleep for period to maintain given sleep_ratio
-
- On my system sleeping for periods less than 1/20th of a second
- doesn't seem to work very accurately, so accumulate at least that
- much time before sleeping.
-
- """
- global been_awake_since
- if been_awake_since is None: # first running
- been_awake_since = time.time()
- else:
- elapsed_time = time.time() - been_awake_since
- sleep_time = elapsed_time * (sleep_ratio/(1-sleep_ratio))
- if sleep_time >= 0.05:
- time.sleep(sleep_time)
- been_awake_since = time.time()
-
def genstrtotime(timestr, curtime = None):
"""Convert a generic time string to a time in seconds"""
if curtime is None: curtime = globals()['curtime']