diff options
author | florent <florent@florent-desktop.(none)> | 2011-01-31 11:13:21 (GMT) |
---|---|---|
committer | florent <florent@florent-desktop.(none)> | 2011-01-31 11:13:21 (GMT) |
commit | c76c5f15285291fc5d4bbcb9fa13f43f29737b50 (patch) | |
tree | 1f9ddcb71ba8f1d37d282e632bd9681d500a8638 |
initial commit
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | MANIFEST | 11 | ||||
-rw-r--r-- | activity.py | 36 | ||||
-rw-r--r-- | activity/activity-atoidepoc.svg | 232 | ||||
-rwxr-xr-x | activity/activity.info | 7 | ||||
-rw-r--r-- | atoidepoc/__init__.py | 0 | ||||
-rw-r--r-- | atoidepoc/ui/__init__.py | 2 | ||||
-rw-r--r-- | atoidepoc/ui/screens.py | 18 | ||||
-rw-r--r-- | atoidepoc/ui/toolbar.py | 53 | ||||
-rw-r--r-- | dist/blank | 0 | ||||
-rw-r--r-- | locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo | bin | 0 -> 373 bytes | |||
-rw-r--r-- | locale/fr/activity.linfo | 2 | ||||
-rw-r--r-- | po/AToiDePoc.pot | 19 | ||||
-rw-r--r-- | po/fr.po | 19 | ||||
-rwxr-xr-x | setup.py | 19 |
15 files changed, 421 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f925f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +syntax: glob +*.pyc +*.swp diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..15c71c8 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,11 @@ +activity.py +setup.py +atoidepoc/__init__.py +atoidepoc/ui/toolbar.py +atoidepoc/ui/__init__.py +activity/activity.info +activity/activity-atoidepoc.svg +po/AToiDePoc.pot +po/fr.po +locale/fr/activity.linfo +locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo diff --git a/activity.py b/activity.py new file mode 100644 index 0000000..d281fb3 --- /dev/null +++ b/activity.py @@ -0,0 +1,36 @@ + +# python import +import logging +from gettext import gettext as _ + +# sugar import +from sugar.activity import activity + +# atoidepoc import +from atoidepoc import ui + +# get application logger +logger = logging.getLogger('atoidepoc') + +# some logging +logger.info('0 - activity start ...') +logger.debug('0 - activity start ...') + +class AToiDePocActivity(activity.Activity): + + def __init__(self, handle): + # init parent + activity.Activity.__init__(self, handle) + # get toolbox + _toolbox = activity.ActivityToolbox(self) + # add tool bars + self.set_toolbox(_toolbox) + # show + _toolbox.show() + # init toolbars + ui.Toolbar(_toolbox, name='default') + # self.set_canvas(self._web_view) + # _toolbox.set_current_toolbar(1) + # some logging + logger.info('1 - activity start ...') + logger.debug('1 - activity start ...') diff --git a/activity/activity-atoidepoc.svg b/activity/activity-atoidepoc.svg new file mode 100644 index 0000000..3f0b931 --- /dev/null +++ b/activity/activity-atoidepoc.svg @@ -0,0 +1,232 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.0" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.47 r22583" + sodipodi:docname="python-logo-inkscape-mono.svg" + width="114" + height="114" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <metadata + id="metadata371"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + inkscape:window-height="882" + inkscape:window-width="1233" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + guidetolerance="10.0" + gridtolerance="10.0" + objecttolerance="10.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" + inkscape:zoom="2.1461642" + inkscape:cx="250.73166" + inkscape:cy="66.577855" + inkscape:window-x="168" + inkscape:window-y="24" + inkscape:current-layer="svg2" + width="210mm" + height="40mm" + units="mm" + showgrid="false" + inkscape:window-maximized="0" /> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 71.887497 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="486.04999 : 71.887497 : 1" + inkscape:persp3d-origin="243.02499 : 47.924998 : 1" + id="perspective46" /> + <linearGradient + id="linearGradient2795"> + <stop + style="stop-color: rgb(184, 184, 184); stop-opacity: 0.498039;" + offset="0" + id="stop2797" /> + <stop + style="stop-color: rgb(127, 127, 127); stop-opacity: 0;" + offset="1" + id="stop2799" /> + </linearGradient> + <linearGradient + id="linearGradient2787"> + <stop + style="stop-color: rgb(127, 127, 127); stop-opacity: 0.5;" + offset="0" + id="stop2789" /> + <stop + style="stop-color: rgb(127, 127, 127); stop-opacity: 0;" + offset="1" + id="stop2791" /> + </linearGradient> + <linearGradient + id="linearGradient3676"> + <stop + style="stop-color: rgb(178, 178, 178); stop-opacity: 0.5;" + offset="0" + id="stop3678" /> + <stop + style="stop-color: rgb(179, 179, 179); stop-opacity: 0;" + offset="1" + id="stop3680" /> + </linearGradient> + <linearGradient + id="linearGradient3236"> + <stop + style="stop-color: rgb(244, 244, 244); stop-opacity: 1;" + offset="0" + id="stop3244" /> + <stop + style="stop-color: white; stop-opacity: 1;" + offset="1" + id="stop3240" /> + </linearGradient> + <linearGradient + id="linearGradient4671"> + <stop + style="stop-color: rgb(255, 212, 59); stop-opacity: 1;" + offset="0" + id="stop4673" /> + <stop + style="stop-color: rgb(255, 232, 115); stop-opacity: 1;" + offset="1" + id="stop4675" /> + </linearGradient> + <linearGradient + id="linearGradient4689"> + <stop + style="stop-color: rgb(90, 159, 212); stop-opacity: 1;" + offset="0" + id="stop4691" /> + <stop + style="stop-color: rgb(48, 105, 152); stop-opacity: 1;" + offset="1" + id="stop4693" /> + </linearGradient> + <linearGradient + x1="224.23996" + y1="144.75717" + x2="-65.308502" + y2="144.75717" + id="linearGradient2987" + xlink:href="#linearGradient4671" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(100.27,99.6112)" /> + <linearGradient + x1="172.94208" + y1="77.475983" + x2="26.670298" + y2="76.313133" + id="linearGradient2990" + xlink:href="#linearGradient4689" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(100.27,99.6112)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4689" + id="linearGradient2587" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(100.27,99.6112)" + x1="172.94208" + y1="77.475983" + x2="26.670298" + y2="76.313133" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4671" + id="linearGradient2589" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(100.27,99.6112)" + x1="224.23996" + y1="144.75717" + x2="-65.308502" + y2="144.75717" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4689" + id="linearGradient2248" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(100.27,99.6112)" + x1="172.94208" + y1="77.475983" + x2="26.670298" + y2="76.313133" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4671" + id="linearGradient2250" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(100.27,99.6112)" + x1="224.23996" + y1="144.75717" + x2="-65.308502" + y2="144.75717" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4671" + id="linearGradient2255" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.562541,0,0,0.567972,-11.5974,-7.60954)" + x1="224.23996" + y1="144.75717" + x2="-65.308502" + y2="144.75717" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4689" + id="linearGradient2258" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.562541,0,0,0.567972,-11.5974,-7.60954)" + x1="172.94208" + y1="76.176224" + x2="26.670298" + y2="76.313133" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2795" + id="radialGradient2801" + cx="61.518883" + cy="132.28575" + fx="61.518883" + fy="132.28575" + r="29.036913" + gradientTransform="matrix(1,0,0,0.177966,0,108.743)" + gradientUnits="userSpaceOnUse" /> + </defs> + <g + id="g2847" + transform="translate(-4.5913706,-5.7860522)"> + <path + id="path1948" + d="m 60.510156,6.3979729 c -4.583653,0.021298 -8.960939,0.4122177 -12.8125,1.09375 C 36.35144,9.4962267 34.291407,13.691825 34.291406,21.429223 l 0,10.21875 26.8125,0 0,3.40625 -26.8125,0 -10.0625,0 c -7.792459,0 -14.6157592,4.683717 -16.7500002,13.59375 -2.46182,10.212966 -2.5710151,16.586023 0,27.25 1.9059283,7.937852 6.4575432,13.593748 14.2500002,13.59375 l 9.21875,0 0,-12.25 c 0,-8.849902 7.657144,-16.656248 16.75,-16.65625 l 26.78125,0 c 7.454951,0 13.406253,-6.138164 13.40625,-13.625 l 0,-25.53125 c 0,-7.266339 -6.12998,-12.7247775 -13.40625,-13.9375001 -4.605987,-0.7667253 -9.385097,-1.1150483 -13.96875,-1.09375 z m -14.5,8.2187501 c 2.769547,0 5.03125,2.298646 5.03125,5.125 -2e-6,2.816336 -2.261703,5.09375 -5.03125,5.09375 -2.779476,-1e-6 -5.03125,-2.277415 -5.03125,-5.09375 -1e-6,-2.826353 2.251774,-5.125 5.03125,-5.125 z" + style="fill:#000000;fill-opacity:1" /> + <path + id="path1950" + d="m 91.228906,35.054223 0,11.90625 c 0,9.230755 -7.825895,16.999999 -16.75,17 l -26.78125,0 c -7.335833,0 -13.406249,6.278483 -13.40625,13.625 l 0,25.531247 c 0,7.26634 6.318588,11.54032 13.40625,13.625 8.487331,2.49561 16.626237,2.94663 26.78125,0 6.750155,-1.95439 13.406253,-5.88761 13.40625,-13.625 l 0,-10.218747 -26.78125,0 0,-3.40625 26.78125,0 13.406254,0 c 7.79246,0 10.69625,-5.435408 13.40624,-13.59375 2.79933,-8.398886 2.68022,-16.475776 0,-27.25 -1.92578,-7.757441 -5.60387,-13.59375 -13.40624,-13.59375 l -10.062504,0 z m -15.0625,64.65625 c 2.779478,3e-6 5.03125,2.277417 5.03125,5.093747 -2e-6,2.82635 -2.251775,5.125 -5.03125,5.125 -2.76955,0 -5.03125,-2.29865 -5.03125,-5.125 2e-6,-2.81633 2.261697,-5.093747 5.03125,-5.093747 z" + style="fill:#000000;fill-opacity:1" /> + </g> +</svg> diff --git a/activity/activity.info b/activity/activity.info new file mode 100755 index 0000000..2cbf109 --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,7 @@ +[Activity] +name = AToiDePoc +activity_version = 1 +service_name = org.laptop.AToiDePocActivity +icon = activity-atoidepoc +class = activity.AToiDePocActivity +license = gplv3 diff --git a/atoidepoc/__init__.py b/atoidepoc/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/atoidepoc/__init__.py diff --git a/atoidepoc/ui/__init__.py b/atoidepoc/ui/__init__.py new file mode 100644 index 0000000..f736ef9 --- /dev/null +++ b/atoidepoc/ui/__init__.py @@ -0,0 +1,2 @@ + +from atoidepoc.ui.toolbar import Toolbar diff --git a/atoidepoc/ui/screens.py b/atoidepoc/ui/screens.py new file mode 100644 index 0000000..46303f2 --- /dev/null +++ b/atoidepoc/ui/screens.py @@ -0,0 +1,18 @@ + +# python import +from gettext import gettext as _ + +# gtk import +import gtk + +class PlayerScreen(gtk.VBox): + + def __init__(self, activity): + # init parent + gtk.Toolbar.__init__(self) + # prepare screen + # ... + # update activity + activity.set_canvas(self) + # show all + self.show_all() diff --git a/atoidepoc/ui/toolbar.py b/atoidepoc/ui/toolbar.py new file mode 100644 index 0000000..96f70f0 --- /dev/null +++ b/atoidepoc/ui/toolbar.py @@ -0,0 +1,53 @@ + +# python import +from gettext import gettext as _ + +# gtk import +import gtk + +# sugar import +from sugar.graphics.toolbutton import ToolButton + +def _cb(widget, data=None): + pass + +BUTTONS = { + 'computer': ['computer', 'Computer', _cb] + } + +TOOLBARS = { + 'default': [ + 'computer' + ] + } + +TITLES = { + 'default': _('Default') + } + +class Toolbar(gtk.Toolbar): + + def __init__(self, toolbox, name='default'): + # init parent + gtk.Toolbar.__init__(self) + # add buttons + for _b in TOOLBARS[name]: + self._add_button(_b) + # add to parent + toolbox.add_toolbar(TITLES[name], self) + # show + self.show() + + def _add_button(self, button_id): + # ... + if button_id in BUTTONS: + _icon, _tooltip, _cb = BUTTONS[button_id] + # ... + _buton = ToolButton(_icon) + _buton.set_tooltip(_tooltip) + _buton.connect('clicked', _cb) + self.insert(_buton, -1) + _buton.show() + # ... + else: + pass diff --git a/dist/blank b/dist/blank new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/dist/blank diff --git a/locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo b/locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo Binary files differnew file mode 100644 index 0000000..cceef50 --- /dev/null +++ b/locale/fr/LC_MESSAGES/org.laptop.AToiDePocActivity.mo diff --git a/locale/fr/activity.linfo b/locale/fr/activity.linfo new file mode 100644 index 0000000..c3fd22d --- /dev/null +++ b/locale/fr/activity.linfo @@ -0,0 +1,2 @@ +[Activity] +name = AToiDePoc diff --git a/po/AToiDePoc.pot b/po/AToiDePoc.pot new file mode 100644 index 0000000..f2236e3 --- /dev/null +++ b/po/AToiDePoc.pot @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-12-29 16:47-0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..21f5239 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2010 +# This file is distributed under the same license as the Calendario package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 3\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-12-29 16:47-0600\n" +"PO-Revision-Date: 2010-12-29 18:02-0600\n" +"Last-Translator: yaderv <yaderv@fedoraproject.org>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset= utf-8\n" +"Content-Transfer-Encoding: 8bit\n" diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..8c17051 --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from sugar.activity import bundlebuilder + +bundlebuilder.start() |