mailr11969 - /branches/bieri_gui/gui_bieri/about.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 27, 2010 - 15:22:
Author: bugman
Date: Mon Dec 27 15:22:51 2010
New Revision: 11969

URL: http://svn.gna.org/viewcvs/relax?rev=11969&view=rev
Log:
The offset variable is now initialised in __init__() in the about base class.


Modified:
    branches/bieri_gui/gui_bieri/about.py

Modified: branches/bieri_gui/gui_bieri/about.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/about.py?rev=11969&r1=11968&r2=11969&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/about.py (original)
+++ branches/bieri_gui/gui_bieri/about.py Mon Dec 27 15:22:51 2010
@@ -57,6 +57,9 @@
 
         # Execute the base class __init__() method.
         super(About_base, self).__init__(*args, **kwds)
+
+        # Initialise the y-offset variable.
+        self._offset_val = 0
 
         # The total size.
         self.total_x = self.dim_x + 2*self.boarder
@@ -135,20 +138,14 @@
         self.build_widget()
 
 
-    def offset(self, val=0, init=False):
-        """Shift the offset by the given value and return the offset.
+    def offset(self, val=0):
+        """Shift the y-offset by the given value and return the new offset.
 
         @keyword val:   The value to add to the offset (can be negative).
         @type val:      int
-        @keyword init:  Flag for initialising the offset.
-        @type init:     bool
-        @return:        The current offset.
+        @return:        The new offset.
         @rtype:         int
         """
-
-        # Initialisation.
-        if init or not hasattr(self, '_offset_val'):
-            self._offset_val = 0
 
         # Shift.
         self._offset_val = self._offset_val + val




Related Messages


Powered by MHonArc, Updated Mon Dec 27 15:40:02 2010