diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-19 14:43:23 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-09-19 14:43:23 (GMT) |
commit | af2a145c39f4e64846c680cc21007a0abc29a840 (patch) | |
tree | ce488cf838b263ae4836193fcd3be20cc87abafb /src | |
parent | e7cdbe116f7cedcd7f632a7b92cd96ece04985e2 (diff) |
Revert "Remove a few doc strings that pydoc does not pick up anyway, replace"
This reverts commit f92b65039fd587818cd131ab676eafaf944a1621.
Diffstat (limited to 'src')
-rw-r--r-- | src/view/home/favoriteslayout.py | 44 | ||||
-rw-r--r-- | src/view/home/favoritesview.py | 6 |
2 files changed, 33 insertions, 17 deletions
diff --git a/src/view/home/favoriteslayout.py b/src/view/home/favoriteslayout.py index 288ab8d..9afb5a2 100644 --- a/src/view/home/favoriteslayout.py +++ b/src/view/home/favoriteslayout.py @@ -98,11 +98,14 @@ class RandomLayout(FavoritesLayout): __gtype_name__ = 'RandomLayout' icon_name = 'view-freeform' + """Name of icon used in home view dropdown palette.""" profile_key = 'random-layout' + """String used in profile to represent this view.""" # TRANS: label for the freeform layout in the favorites view palette_name = _('Freeform') + """String used to identify this layout in home view dropdown palette.""" def __init__(self): FavoritesLayout.__init__(self) @@ -178,14 +181,13 @@ class RingLayout(FavoritesLayout): """Lay out icons in a ring around the XO man.""" __gtype_name__ = 'RingLayout' - icon_name = 'view-radial' - + """Name of icon used in home view dropdown palette.""" profile_key = 'ring-layout' - + """String used in profile to represent this view.""" # TRANS: label for the ring layout in the favorites view palette_name = _('Ring') - + """String used to identify this layout in home view dropdown palette.""" def __init__(self): FavoritesLayout.__init__(self) @@ -289,25 +291,30 @@ class RingLayout(FavoritesLayout): else: return 0 -# Chose a constant such that STANDARD_ICON_SIZE icons are nicely spaced. _SUNFLOWER_CONSTANT = style.STANDARD_ICON_SIZE * .75 +"""Chose a constant such that STANDARD_ICON_SIZE icons are nicely spaced.""" - -# Compute a starting index for the `SunflowerLayout` which leaves space for -# the XO man in the center. Since r = _SUNFLOWER_CONSTANT * sqrt(n), -# solve for n when r is (XLARGE_ICON_SIZE + STANDARD_ICON_SIZE)/2. _SUNFLOWER_OFFSET = \ math.pow((style.XLARGE_ICON_SIZE / 2 + style.STANDARD_ICON_SIZE) / _SUNFLOWER_CONSTANT, 2) +""" +Compute a starting index for the `SunflowerLayout` which leaves space for +the XO man in the center. Since r = _SUNFLOWER_CONSTANT * sqrt(n), +solve for n when r is (XLARGE_ICON_SIZE + STANDARD_ICON_SIZE)/2. +""" -# Golden ratio: http://en.wikipedia.org/wiki/Golden_ratio -# Calculation: (math.sqrt(5) + 1) / 2 _GOLDEN_RATIO = 1.6180339887498949 +""" +Golden ratio: http://en.wikipedia.org/wiki/Golden_ratio +Calculation: (math.sqrt(5) + 1) / 2 +""" -# The sunflower angle is approximately 137.5 degrees. -# This is the golden angle: http://en.wikipedia.org/wiki/Golden_angle -# Calculation: math.radians(360) / ( _GOLDEN_RATIO * _GOLDEN_RATIO ) _SUNFLOWER_ANGLE = 2.3999632297286531 +""" +The sunflower angle is approximately 137.5 degrees. +This is the golden angle: http://en.wikipedia.org/wiki/Golden_angle +Calculation: math.radians(360) / ( _GOLDEN_RATIO * _GOLDEN_RATIO ) +""" class SunflowerLayout(RingLayout): """Spiral layout based on Fibonacci ratio in phyllotaxis. @@ -318,11 +325,14 @@ class SunflowerLayout(RingLayout): __gtype_name__ = 'SunflowerLayout' icon_name = 'view-spiral' + """Name of icon used in home view dropdown palette.""" profile_key = 'spiral-layout' + """String used in profile to represent this view.""" # TRANS: label for the spiral layout in the favorites view palette_name = _('Spiral') + """String used to identify this layout in home view dropdown palette.""" def __init__(self): RingLayout.__init__(self) @@ -382,11 +392,14 @@ class BoxLayout(RingLayout): __gtype_name__ = 'BoxLayout' icon_name = 'view-box' + """Name of icon used in home view dropdown palette.""" profile_key = 'box-layout' + """String used in profile to represent this view.""" # TRANS: label for the box layout in the favorites view palette_name = _('Box') + """String used to identify this layout in home view dropdown palette.""" def __init__(self): RingLayout.__init__(self) @@ -420,11 +433,14 @@ class TriangleLayout(RingLayout): __gtype_name__ = 'TriangleLayout' icon_name = 'view-triangle' + """Name of icon used in home view dropdown palette.""" profile_key = 'triangle-layout' + """String used in profile to represent this view.""" # TRANS: label for the box layout in the favorites view palette_name = _('Triangle') + """String used to identify this layout in home view dropdown palette.""" def __init__(self): RingLayout.__init__(self) diff --git a/src/view/home/favoritesview.py b/src/view/home/favoritesview.py index ce6c885..fc42e2d 100644 --- a/src/view/home/favoritesview.py +++ b/src/view/home/favoritesview.py @@ -51,14 +51,14 @@ _ICON_DND_TARGET = ('activity-icon', gtk.TARGET_SAME_WIDGET, 0) RING_LAYOUT, BOX_LAYOUT, TRIANGLE_LAYOUT, SUNFLOWER_LAYOUT, RANDOM_LAYOUT = \ xrange(5) -# Map numeric layout identifiers to uninstantiated subclasses of -# `FavoritesLayout` which implement the layouts. Additional information -# about the layout can be accessed with fields of the class. LAYOUT_MAP = {RING_LAYOUT: favoriteslayout.RingLayout, #BOX_LAYOUT: favoriteslayout.BoxLayout, #TRIANGLE_LAYOUT: favoriteslayout.TriangleLayout, SUNFLOWER_LAYOUT: favoriteslayout.SunflowerLayout, RANDOM_LAYOUT: favoriteslayout.RandomLayout} +"""Map numeric layout identifiers to uninstantiated subclasses of +`FavoritesLayout` which implement the layouts. Additional information +about the layout can be accessed with fields of the class.""" class FavoritesView(hippo.Canvas): __gtype_name__ = 'SugarFavoritesView' |