[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [nyx/master] Drop most Panel constructor arguments



commit 5199380f4aeda3b763bc3077c713cb0f51846249
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Apr 17 18:10:51 2016 -0700

    Drop most Panel constructor arguments
    
    The location and dimension arguments were only around for popups. Now that
    those use the new nyx.curses functions no need to keep them around.
---
 nyx/panel/__init__.py   | 14 +++++++-------
 nyx/panel/connection.py |  2 +-
 nyx/panel/header.py     |  2 +-
 nyx/panel/log.py        |  2 +-
 nyx/panel/torrc.py      |  2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/nyx/panel/__init__.py b/nyx/panel/__init__.py
index 86e64ac..39b8f85 100644
--- a/nyx/panel/__init__.py
+++ b/nyx/panel/__init__.py
@@ -166,7 +166,7 @@ class Panel(object):
   redraw().
   """
 
-  def __init__(self, name, top = 0, left = 0, height = -1, width = -1):
+  def __init__(self, name):
     """
     Creates a durable wrapper for a curses subwindow in the given parent.
 
@@ -188,10 +188,10 @@ class Panel(object):
     self.paused = False
     self.pause_time = -1
 
-    self.top = top
-    self.left = left
-    self.height = height
-    self.width = width
+    self.top = 0
+    self.left = 0
+    self.height = -1
+    self.width = -1
 
     # The panel's subwindow instance. This is made available to implementors
     # via their draw method and shouldn't be accessed directly.
@@ -714,8 +714,8 @@ class Panel(object):
 
 
 class DaemonPanel(Panel, threading.Thread):
-  def __init__(self, name, top = 0, left = 0, height = -1, width = -1, update_rate = 10):
-    Panel.__init__(self, name, top, left, height, width)
+  def __init__(self, name, update_rate):
+    Panel.__init__(self, name)
     threading.Thread.__init__(self)
     self.setDaemon(True)
 
diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index b75376d..863be22 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -262,7 +262,7 @@ class ConnectionPanel(nyx.panel.DaemonPanel):
   """
 
   def __init__(self):
-    nyx.panel.DaemonPanel.__init__(self, 'connections', update_rate = UPDATE_RATE)
+    nyx.panel.DaemonPanel.__init__(self, 'connections', UPDATE_RATE)
 
     self._scroller = nyx.curses.CursorScroller()
     self._entries = []            # last fetched display entries
diff --git a/nyx/panel/header.py b/nyx/panel/header.py
index df139f0..2441704 100644
--- a/nyx/panel/header.py
+++ b/nyx/panel/header.py
@@ -44,7 +44,7 @@ class HeaderPanel(nyx.panel.DaemonPanel):
   """
 
   def __init__(self):
-    nyx.panel.DaemonPanel.__init__(self, 'header', update_rate = UPDATE_RATE)
+    nyx.panel.DaemonPanel.__init__(self, 'header', UPDATE_RATE)
     self._vals = Sampling.create()
 
     self._last_width = nyx.curses.screen_size()[0]
diff --git a/nyx/panel/log.py b/nyx/panel/log.py
index 1e1e87e..3e8932d 100644
--- a/nyx/panel/log.py
+++ b/nyx/panel/log.py
@@ -66,7 +66,7 @@ class LogPanel(nyx.panel.DaemonPanel):
   """
 
   def __init__(self):
-    nyx.panel.DaemonPanel.__init__(self, 'log', update_rate = UPDATE_RATE)
+    nyx.panel.DaemonPanel.__init__(self, 'log', UPDATE_RATE)
 
     logged_events = nyx.arguments.expand_events(CONFIG['startup.events'])
     self._event_log = nyx.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = True)
diff --git a/nyx/panel/torrc.py b/nyx/panel/torrc.py
index 2943807..b279ea0 100644
--- a/nyx/panel/torrc.py
+++ b/nyx/panel/torrc.py
@@ -24,7 +24,7 @@ class TorrcPanel(panel.Panel):
   """
 
   def __init__(self):
-    panel.Panel.__init__(self, 'torrc', 0)
+    panel.Panel.__init__(self, 'torrc')
 
     self._scroller = nyx.curses.Scroller()
     self._show_line_numbers = True  # shows left aligned line numbers



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits