summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'segget/scripts/net0.py')
-rw-r--r--segget/scripts/net0.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/segget/scripts/net0.py b/segget/scripts/net0.py
new file mode 100644
index 0000000..8d87955
--- /dev/null
+++ b/segget/scripts/net0.py
@@ -0,0 +1,15 @@
+from functions import *
+import time;
+def schedule():
+ localtime = time.localtime(time.time());
+ hour=localtime[3];
+ # disable downloading distfiles that have size more than 5 000 000 bytes
+ # from 8-00 to 22-00.
+ if hour>8 and hour<21 and (get("distfile.size"))>5000000:
+ print "reject because distfile is too big"
+ reject_segment()
+ # set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes
+ if get("distfile.size")>1000000:
+ print "limit connection speed"
+ set(connection.max_speed_limit, 50000)
+ accept_segment() \ No newline at end of file