gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14418 - gauger


From: gnunet
Subject: [GNUnet-SVN] r14418 - gauger
Date: Wed, 16 Feb 2011 03:11:50 +0100

Author: bartpolot
Date: 2011-02-16 03:11:50 +0100 (Wed, 16 Feb 2011)
New Revision: 14418

Modified:
   gauger/gauger.py
Log:
Added gauger server code to maintain global range


Modified: gauger/gauger.py
===================================================================
--- gauger/gauger.py    2011-02-16 01:49:23 UTC (rev 14417)
+++ gauger/gauger.py    2011-02-16 02:11:50 UTC (rev 14418)
@@ -93,6 +93,12 @@
   processedfile.close()
 
 
+f = open("global_range.dat", "r+");
+xrange_min,xrange_max = f.readline().split(' ');
+xrange_min = int(xrange_min);
+xrange_max = int(xrange_max);
+f.close();
+
 s1 = socket(AF_INET, SOCK_STREAM)
 s1.bind(("0.0.0.0", 10111))
 s1.listen(5)
@@ -125,3 +131,10 @@
   add_data_to_file(datafile, revision, result);
   datafile.close()
   updateplot(hostname, dataname)
+  revision = int(revision);
+  if(revision > xrange_max or revision < xrange_min):
+    xrange_max = max(xrange_max, revision);
+    xrange_min = min(xrange_min, revision);
+    f = open("global_range.dat", "w");
+    f.write("%d %d" % (xrange_min, xrange_max));
+    f.close();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]