commit c4e034f4789fe2ef65b6d3bed78d59ed308087cb
Merge: e3b7f0e 426c879
Author: Damian Johnson <atagar(a)torproject.org>
Date: Wed Jul 7 16:48:51 2010 +0000
Rewrite of the first third of the interface, providing vastly improved performance, maintainability, and a few very nice features.
added: settings are fetched from an optional armrc (update rates, controller password, caching, runlevels, etc)
added: system tools util providing simplified usage, suppression of leaks to stdout, logging, and optional caching
added: wrapper for accessing TorCtl providing:
- client side caching for commonly fetched relay information (fingerprint, descriptor, etc)
- singleton accessor and convenience functions, simplifying interface code
- wrapper allowing reattachment to new controllers (ie, arm still works if tor's stopped then restarted - still in the works)
change: full rewrite of the header panel, providing:
- notice for when tor's disconnected (with time-stamp)
- lightweight redrawing (smarter caching and moved updating into a daemon thread)
- more graceful handling of tiny displays
change: rewrite of graph panel and related stats, providing:
- prepopulation of bandwidth information from the state file if possible
- observed and measured bandwidth stats (requested by arma)
- graph can be configured to display any numeric ps stat
- third option for graphing bounds (restricting to both local minima and maxima)
- substantially reduced redraw rate and making use of cached ps parameters (reducing call volume)
fix: preventing 'command unavailable' error messages from going to stdout, which disrupts the display (caught by sid77)
fix: removed -p option due to being a gaping security problem (caught by ioerror and nickm)
fix: crashing issue if TorCtl reports TorCtlClosed before the first refresh (caught by Tas)
fix: preventing the connection panel from initiating or resetting while in blind mode (caught by micah)
fix: ss resolution wasn't specifying the use of numeric ports (caught by data)
fix: parsing error when ExitPolicy is undefined (caught by Paul Menzel)
fix: revised sleep pattern used for threads, greatly reducing the time it takes to quit
fix: bug in defaulting the connection resolver to something predetermined to be available
fix: stopping connection resolution (and related failover message) when tor's stopped
fix: crashing issue when trying to resolve addresses without network connectivity
fix: forgot to join on connection resolver when quitting
fix: revised calculation for effective bandwidth rate to take MaxAdvertisedBandwidth into account
svn:r22617
ChangeLog | 32 ++
README | 30 +-
TODO | 301 +++++++-----
armrc.sample | 82 ++++
init/project113.py | 192 ++++++++
init/starter.py | 188 ++++----
interface/__init__.py | 2 +-
interface/bandwidthMonitor.py | 185 -------
interface/confPanel.py | 4 +-
interface/connCountMonitor.py | 57 ---
interface/connPanel.py | 11 +-
interface/controller.py | 377 +++++++--------
interface/cpuMemMonitor.py | 54 --
interface/fileDescriptorPopup.py | 21 +-
interface/graphPanel.py | 279 -----------
interface/graphing/__init__.py | 6 +
interface/graphing/bandwidthStats.py | 348 ++++++++++++++
interface/graphing/connStats.py | 51 ++
interface/graphing/graphPanel.py | 363 ++++++++++++++
interface/graphing/psStats.py | 129 +++++
interface/headerPanel.py | 485 +++++++++++--------
interface/logPanel.py | 30 +-
util/__init__.py | 2 +-
util/conf.py | 246 ++++++++++
util/connections.py | 142 ++++--
util/hostnames.py | 75 ++-
util/log.py | 59 ++-
util/panel.py | 62 ++-
util/sysTools.py | 172 +++++++
util/torTools.py | 877 ++++++++++++++++++++++++++++++++++
util/uiTools.py | 78 +++-
31 files changed, 3593 insertions(+), 1347 deletions(-)
diff --cc init/starter.py
index d95672e,a58b687..8ce8315
--- a/init/starter.py
+++ b/init/starter.py
@@@ -14,18 -13,30 +13,30 @@@ import getop
# includes parent directory rather than init in path (so sibling modules are included)
sys.path[0] = sys.path[0][:-5]
- from TorCtl import TorCtl, TorUtil
- from interface import controller, logPanel
+ import interface.controller
+ import interface.logPanel
+ import util.conf
+ import util.connections
+ import util.hostnames
+ import util.log
+ import util.panel
+ import util.sysTools
+ import util.torTools
+ import util.uiTools
+ import TorCtl.TorUtil
- VERSION = "1.3.5"
- LAST_MODIFIED = "Apr 8, 2010"
-VERSION = "1.3.6_dev"
++VERSION = "1.3.6"
+ LAST_MODIFIED = "July 7, 2010"
- DEFAULT_CONTROL_ADDR = "127.0.0.1"
- DEFAULT_CONTROL_PORT = 9051
- DEFAULT_LOGGED_EVENTS = "N3" # tor and arm NOTICE, WARN, and ERR events
+ DEFAULT_CONFIG = os.path.expanduser("~/.armrc")
+ DEFAULTS = {"startup.controlPassword": None,
+ "startup.interface.ipAddress": "127.0.0.1",
+ "startup.interface.port": 9051,
+ "startup.blindModeEnabled": False,
+ "startup.events": "N3"}
- OPT = "i:p:be:vh"
- OPT_EXPANDED = ["interface=", "password=", "blind", "event=", "version", "help"]
+ OPT = "i:c:be:vh"
+ OPT_EXPANDED = ["interface=", "config=", "blind", "event=", "version", "help"]
HELP_MSG = """Usage arm [OPTION]
Terminal status monitor for Tor relays.