Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-09-12 23:29:11 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-09-12 23:29:11 (GMT)
commit2c11fc425ff13533843eec2c588ac718301501ac (patch)
tree70a85e6b08d654ee5c3fc90adca54f9dcc1028d3
parentc9b4dcde5c8c8be6cf2384ec9872dda794d31841 (diff)
Add docstrings in basic_options and color item (Desktop modules)
-rw-r--r--desktop/sweetener/basic_options.py14
-rw-r--r--desktop/sweetener/coloritem.py15
2 files changed, 23 insertions, 6 deletions
diff --git a/desktop/sweetener/basic_options.py b/desktop/sweetener/basic_options.py
index 0967442..83636e1 100644
--- a/desktop/sweetener/basic_options.py
+++ b/desktop/sweetener/basic_options.py
@@ -1,6 +1,7 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
+"""
+This module provides a "File" menu at desktops and an ActivityToolbar at Sugar.
+See class BasicOptions.
+"""
# Copyright (C) 2012 S. Daniel Francis <francis@sugarlabs.org>
#
# This program is free software; you can redistribute it and/or modify
@@ -30,7 +31,14 @@ CONFIG = 1
class BasicOptions(ItemGroup):
+ """This class has the basic options for your program."""
def __init__(self, activity, box, export_formats=None):
+ """Create and append the basic items to a ItemBox.
+ activity -- The activity used as argument at Canvas and Options.
+ box -- sweetener.itembox.ItemBox of the activity.
+ export_formats -- list of tuples or none. Each tuple should have:
+ ['generic_type', 'mime_type', 'mime_filter', 'filter_name']
+ """
ItemGroup.__init__(self, box, _('_File'), None)
if activity.save_type != CONFIG:
diff --git a/desktop/sweetener/coloritem.py b/desktop/sweetener/coloritem.py
index d71d37e..1db0e69 100644
--- a/desktop/sweetener/coloritem.py
+++ b/desktop/sweetener/coloritem.py
@@ -1,6 +1,4 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
+"""The color item gives the user the posibility to choice a colour."""
# Copyright (C) 2012 S. Daniel Francis <francis@sugarlabs.org>
#
# This program is free software; you can redistribute it and/or modify
@@ -29,15 +27,26 @@ from item import Item
class ColorItem(Item):
+ """Color Selecting interface.
+ In Sugar it creates a sugar.graphics.colorbutton.ColorToolButton.
+ In other desktops it's a sweetener.item.Item connected to a
+ gtk.ColorSelectionDialog.
+ """
__gsignals__ = {'updated': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
(gobject.TYPE_STRING,))}
def __init__(self, parent=None, important=False):
+ """Constructor.
+ parent -- A window where focus the dialog or None.
+ important -- bool , if it's True, in desktops a ToolItem will be
+ appended to the Toolbar.
+ """
Item.__init__(self, gtk.STOCK_SELECT_COLOR, important)
self.parent = parent
self.color = '#FFFFFF'
def set_color(self, color):
+ """color -- RGB color"""
self.color = color
def _color_changed_cb(self, widget):