Author: atagar Date: 2011-04-02 19:57:30 +0000 (Sat, 02 Apr 2011) New Revision: 24532
Modified: arm/trunk/src/interface/connections/connEntry.py arm/trunk/src/interface/connections/entries.py arm/trunk/src/interface/controller.py Log: Notes for the descriptor popup. This is a very rarely used part of the interface and won't be implemented until 1.4.3.
Modified: arm/trunk/src/interface/connections/connEntry.py =================================================================== --- arm/trunk/src/interface/connections/connEntry.py 2011-04-02 02:26:05 UTC (rev 24531) +++ arm/trunk/src/interface/connections/connEntry.py 2011-04-02 19:57:30 UTC (rev 24532) @@ -325,6 +325,21 @@ detailFormat = curses.A_BOLD | uiTools.getColor(CATEGORY_COLOR[self.getType()]) return [uiTools.DrawEntry(line, detailFormat) for line in self._getDetailContent(width)]
+ def _getDescriptors(self, width): + """ + Provides raw descriptor information for the relay. + + Arguments: + width - available space to display in + """ + + # TODO: Porting and refactoring the descriptorPopup.py functionality is + # gonna take quite a bit of work. This is a very rarely used feature and + # not worth delaying the 1.4.2 release any further, so this will be a part + # of 1.4.3. + + return [] + def resetDisplay(self): entries.ConnectionPanelLine.resetDisplay(self) self.cachedType = None
Modified: arm/trunk/src/interface/connections/entries.py =================================================================== --- arm/trunk/src/interface/connections/entries.py 2011-04-02 02:26:05 UTC (rev 24531) +++ arm/trunk/src/interface/connections/entries.py 2011-04-02 19:57:30 UTC (rev 24532) @@ -102,6 +102,9 @@
self._detailsCache = None self._detailsCacheArgs = None + + self._descriptorCache = None + self._descriptorCacheArgs = None
def getListingEntry(self, width, currentTime, listingType): """ @@ -142,9 +145,28 @@ return self._detailsCache
def _getDetails(self, width): - # implementation of getListing + # implementation of getDetails return []
+ def getDescriptor(self, width): + """ + Provides a list of DrawEntry instances with descriptor informatoin for + this connection. + + Arguments: + width - available space to display in + """ + + if self._descriptorCacheArgs != width: + self._descriptorCache = self._getDescriptor(width) + self._descriptorCacheArgs = width + + return self._descriptorCache + + def _getDescriptor(self, width): + # implementation of getDescriptor + return [] + def resetDisplay(self): """ Flushes cached display results.
Modified: arm/trunk/src/interface/controller.py =================================================================== --- arm/trunk/src/interface/controller.py 2011-04-02 02:26:05 UTC (rev 24531) +++ arm/trunk/src/interface/controller.py 2011-04-02 19:57:30 UTC (rev 24532) @@ -1003,7 +1003,7 @@ popup.addfstr(2, 41, "<b>page down</b>: scroll down a page")
popup.addfstr(3, 2, "<b>enter</b>: edit configuration option") - popup.addfstr(3, 41, "<b>d</b>: raw consensus descriptor") + #popup.addfstr(3, 41, "<b>d</b>: raw consensus descriptor")
listingType = panels["conn2"]._listingType.lower() popup.addfstr(4, 2, "<b>l</b>: listed identity (<b>%s</b>)" % listingType) @@ -1013,6 +1013,8 @@ resolverUtil = connections.getResolver("tor").overwriteResolver if resolverUtil == None: resolverUtil = "auto" popup.addfstr(5, 2, "<b>u</b>: resolving utility (<b>%s</b>)" % resolverUtil) + + pageOverrideKeys = (ord('l'), ord('s'), ord('u')) elif page == 3: popup.addfstr(1, 2, "<b>up arrow</b>: scroll up a line") popup.addfstr(1, 41, "<b>down arrow</b>: scroll down a line")
tor-commits@lists.torproject.org