Re: [Sugar-devel] [IAEP] About to teach Python programming

2013-01-14 Thread Mike Rehner
Here is a list of Python resources if that would help-
http://www.babarehner.com/ewrench1011/Python/index.html

Cheers,

Mike

On Mon, Jan 14, 2013 at 6:31 PM, Gerald Ardito  wrote:
> Stephen,
>
> I am starting two weeks from tomorrow.
> I am still trying to wrap my head about the key goals and projects. It would
> be great to share ideas.
>
> Gerald
>
> On Monday, January 14, 2013 at 6:08 PM, Steve Thomas wrote:
>
> On Sat, Jan 12, 2013 at 9:58 PM,  wrote:
>
> Hi
>
> As a beginner, I found creating a Sugar Activity difficult. More difficult
> than creating a program to run from Terminal or Pippy. You might get better
> value using Pygame and writing something that can run from Pippy. The goal
> could be to create more Pippy built in samples.
>
> If you are going to write an Activity, you could give them a 'hello world'
> template and get them to build on that rather than starting from the
> beginning. Your 'hello world' template could have the basics:a text box for
> text entry/display, a canvas for graphical display and an example of
> keyboard and mouse capture.
>
> Agreed. Having a template to build on for an Activity would make things much
> simpler.
>
>
> Good luck. Please ask if you need help.
>
> Ditto.  When will you start the class?  I am also teaching Python to some
> kids now, and  interested sharing ideas.
>
> Stephen
>
>
> Tony
>
>>  wrote:
>> > Hello.
>> > I have been asked by my school district to teach a one semester course
>> > on
>> > computer programming to some of our high school students. I was already
>> > settled on Python. In my planning, I thought it would be great if the
>> > students built an application for Sugar/XO Laptop. I have, as I think
>> > you
>> > know, been using them in our school for a few years, I think the
>> > transition
>> > from consumer to producer would be great.
>> >
>> > I am not a Python programmer, although I understand the basic concepts
>> > and
>> > can muddle my way through. So,here's my question -- what should the
>> > students
>> > know/be able to do in Python before they are able to write an Activity?
>>
>> Beyond the basics, understanding the concept of classes and
>> inheritance is pretty essential. Some GTK stuff, but that is pretty
>> straightforward.
>>
>> -walter
>>
>> >
>> > I hope this makes sense. And I appreciate your time.
>> >
>> > Best,
>> > Gerald Ardito
>> >
>> > ___
>> > Sugar-devel mailing list
>> > Sugar-devel@lists.sugarlabs.org
>> > http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>>
>>
>>
>> --
>> Walter Bender
>> Sugar Labs
>> http://www.sugarlabs.org
>> ___
>> Sugar-devel mailing list
>> Sugar-devel@lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>
>> _
>> This mail has been virus scanned by Australia On Line
>> see http://www.australiaonline.net.au/mailscanning
>
> ___
>
> IAEP -- It's An Education Project (not a laptop project!)
> i...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/iaep
>
>
>
>
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Mike Rehner
Groveport (Columbus) OH 43125
USA
614 497 9774
www.e-wrench.com
aldebaran.dnsdojo.org (Moodle test server)
www.youtube.com/user/babarehner (YouTube Channel)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [IAEP] About to teach Python programming

2013-01-14 Thread Gerald Ardito
Stephen, 

I am starting two weeks from tomorrow. 
I am still trying to wrap my head about the key goals and projects. It would be 
great to share ideas.

Gerald 


On Monday, January 14, 2013 at 6:08 PM, Steve Thomas wrote:

> On Sat, Jan 12, 2013 at 9:58 PM,  (mailto:fors...@ozonline.com.au)> wrote:
> > Hi
> > 
> > As a beginner, I found creating a Sugar Activity difficult. More difficult 
> > than creating a program to run from Terminal or Pippy. You might get better 
> > value using Pygame and writing something that can run from Pippy. The goal 
> > could be to create more Pippy built in samples.
> > 
> > If you are going to write an Activity, you could give them a 'hello world' 
> > template and get them to build on that rather than starting from the 
> > beginning. Your 'hello world' template could have the basics:a text box for 
> > text entry/display, a canvas for graphical display and an example of 
> > keyboard and mouse capture.
> Agreed. Having a template to build on for an Activity would make things much 
> simpler.
>  
> > Good luck. Please ask if you need help.
> Ditto.  When will you start the class?  I am also teaching Python to some 
> kids now, and  interested sharing ideas.
> 
> Stephen
> > 
> > Tony
> > 
> > > mailto:gerald.ard...@gmail.com)> wrote:
> > > > Hello.
> > > > I have been asked by my school district to teach a one semester course 
> > > > on
> > > > computer programming to some of our high school students. I was already
> > > > settled on Python. In my planning, I thought it would be great if the
> > > > students built an application for Sugar/XO Laptop. I have, as I think 
> > > > you
> > > > know, been using them in our school for a few years, I think the 
> > > > transition
> > > > from consumer to producer would be great.
> > > >
> > > > I am not a Python programmer, although I understand the basic concepts 
> > > > and
> > > > can muddle my way through. So,here's my question -- what should the 
> > > > students
> > > > know/be able to do in Python before they are able to write an Activity?
> > >
> > > Beyond the basics, understanding the concept of classes and
> > > inheritance is pretty essential. Some GTK stuff, but that is pretty
> > > straightforward.
> > >
> > > -walter
> > >
> > > >
> > > > I hope this makes sense. And I appreciate your time.
> > > >
> > > > Best,
> > > > Gerald Ardito
> > > >
> > > > ___
> > > > Sugar-devel mailing list
> > > > Sugar-devel@lists.sugarlabs.org (mailto:Sugar-devel@lists.sugarlabs.org)
> > > > http://lists.sugarlabs.org/listinfo/sugar-devel
> > > >
> > >
> > >
> > >
> > > --
> > > Walter Bender
> > > Sugar Labs
> > > http://www.sugarlabs.org
> > > ___
> > > Sugar-devel mailing list
> > > Sugar-devel@lists.sugarlabs.org (mailto:Sugar-devel@lists.sugarlabs.org)
> > > http://lists.sugarlabs.org/listinfo/sugar-devel
> > >
> > > _
> > > This mail has been virus scanned by Australia On Line
> > > see http://www.australiaonline.net.au/mailscanning
> > 
> > ___
> > IAEP -- It's An Education Project (not a laptop project!)
> > i...@lists.sugarlabs.org (mailto:i...@lists.sugarlabs.org)
> > http://lists.sugarlabs.org/listinfo/iaep
> 

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [IAEP] About to teach Python programming

2013-01-14 Thread James Simmons
Steve,

In my book I develop an e-book reader, starting with a standalone program
and then converting it to a simple Activity, followed by adding toolbars,
etc.  The examples are simple but not trivial.  I'm not a big fan of "Hello
World".  I prefer a simple program that actually does something useful.  I
don't have to understand absolutely every line of code to learn from an
example.

My first exposure to Turbo C was Hello World.  However, I really learned
the language by typing in code for useful programs in "C Chest And Other C
Treasures", especially since I didn't always type them in correctly and
then I had to figure out where I went wrong.

If I was teaching a class I'd probably use the examples in my book.  I've
never taught a class in anything so I have no idea if that would work, but
that's how I would do it.

The worst computer class I ever took was my introductory BAL class.  We had
"Green Cards" (IBM Assembly Pocket Reference) and we spent several class
periods going over BAL instructions and what they did.  It was probably the
dumbest way you could teach BAL.

James Simmons


On Mon, Jan 14, 2013 at 5:08 PM, Steve Thomas  wrote:

> On Sat, Jan 12, 2013 at 9:58 PM,  wrote:
>
>> Hi
>>
>> As a beginner, I found creating a Sugar Activity difficult. More
>> difficult than creating a program to run from Terminal or Pippy. You might
>> get better value using Pygame and writing something that can run from
>> Pippy. The goal could be to create more Pippy built in samples.
>>
>> If you are going to write an Activity, you could give them a 'hello
>> world' template and get them to build on that rather than starting from the
>> beginning. Your 'hello world' template could have the basics:a text box for
>> text entry/display, a canvas for graphical display and an example of
>> keyboard and mouse capture.
>>
> Agreed. Having a template to build on for an Activity would make things
> much simpler.
>
>
>> Good luck. Please ask if you need help.
>>
> Ditto.  When will you start the class?  I am also teaching Python to some
> kids now, and  interested sharing ideas.
>
> Stephen
>
>>
>> Tony
>>
>> >  wrote:
>> > > Hello.
>> > > I have been asked by my school district to teach a one semester
>> course on
>> > > computer programming to some of our high school students. I was
>> already
>> > > settled on Python. In my planning, I thought it would be great if the
>> > > students built an application for Sugar/XO Laptop. I have, as I think
>> you
>> > > know, been using them in our school for a few years, I think the
>> transition
>> > > from consumer to producer would be great.
>> > >
>> > > I am not a Python programmer, although I understand the basic
>> concepts and
>> > > can muddle my way through. So,here's my question -- what should the
>> students
>> > > know/be able to do in Python before they are able to write an
>> Activity?
>> >
>> > Beyond the basics, understanding the concept of classes and
>> > inheritance is pretty essential. Some GTK stuff, but that is pretty
>> > straightforward.
>> >
>> > -walter
>> >
>> > >
>> > > I hope this makes sense. And I appreciate your time.
>> > >
>> > > Best,
>> > > Gerald Ardito
>> > >
>> > > ___
>> > > Sugar-devel mailing list
>> > > Sugar-devel@lists.sugarlabs.org
>> > > http://lists.sugarlabs.org/listinfo/sugar-devel
>> > >
>> >
>> >
>> >
>> > --
>> > Walter Bender
>> > Sugar Labs
>> > http://www.sugarlabs.org
>> > ___
>> > Sugar-devel mailing list
>> > Sugar-devel@lists.sugarlabs.org
>> > http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>> > _
>> > This mail has been virus scanned by Australia On Line
>> > see http://www.australiaonline.net.au/mailscanning
>>
>> ___
>> IAEP -- It's An Education Project (not a laptop project!)
>> i...@lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/iaep
>>
>
>
> ___
> IAEP -- It's An Education Project (not a laptop project!)
> i...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/iaep
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [sugar-build] New location of the docs

2013-01-14 Thread Gonzalo Odiard
Nice docs!
Can you add my favorite preference?
RUN_IN_WINDOW=1

Gonzalo

On Mon, Jan 14, 2013 at 11:00 AM, Daniel Narvaez wrote:

> I changed how we upload documents in buildbot and I had to change the
> directory where they are stored. Now they are available at:
>
> http://sugarlabs.org/~buildbot/docs/index.html
>
> --
> Daniel Narvaez
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] New location of the binary snapshots

2013-01-14 Thread Daniel Narvaez
I had to move the binary snapshot to the buildbot directory. So now
they are available at:

http://sugarlabs.org/~buildbot/snapshots/

-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [sugar-build] New location of the docs

2013-01-14 Thread Daniel Narvaez
I changed how we upload documents in buildbot and I had to change the
directory where they are stored. Now they are available at:

http://sugarlabs.org/~buildbot/docs/index.html

-- 
Daniel Narvaez
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Start the activity when the treeview row is activated

2013-01-14 Thread Simon Schampijer

Thanks Daniel!

Tested to not introduce regressions for mouse usage. And tested with 
your 'make check' test, impressive work, I was able to detect an error 
with stopping my Terminal and could pinpoint back using the logs in 
logs/check.log. Go sugar-build go!


Pushed as: 0bf9d535f55ed4b93e951de0fb980196cff84815

Cheers,
   Simon


On 12/03/2012 01:59 AM, Daniel Narvaez wrote:

From: Daniel Narvaez 

This makes the "activate" accessible action work, which is useful
both for the UI tests and accessibility.
It shouldn't interfer with the normal mouse behavior because gtk
only calls row_activated on a double click.
---
  src/jarabe/desktop/activitieslist.py |8 
  1 file changed, 8 insertions(+)

diff --git a/src/jarabe/desktop/activitieslist.py 
b/src/jarabe/desktop/activitieslist.py
index 6594ee9..738a54f 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -80,6 +80,8 @@ class ActivitiesTreeView(Gtk.TreeView):
  column.add_attribute(cell_icon, 'file-name', ListModel.COLUMN_ICON)
  self.append_column(column)

+self._icon_column = column
+
  cell_text = Gtk.CellRendererText()
  cell_text.props.ellipsize = Pango.EllipsizeMode.MIDDLE
  cell_text.props.ellipsize_set = True
@@ -143,6 +145,9 @@ class ActivitiesTreeView(Gtk.TreeView):
   not row[ListModel.COLUMN_FAVORITE])

  def __icon_clicked_cb(self, cell, path):
+self._start_activity(path)
+
+def _start_activity(self, path):
  row = self.get_model()[path]

  registry = bundleregistry.get_registry()
@@ -165,6 +170,9 @@ class ActivitiesTreeView(Gtk.TreeView):
  title = normalize_string(title.decode('utf-8'))
  return title is not None and title.find(self._query) > -1

+def do_row_activated(self, path, column):
+if column == self._icon_column:
+self._start_activity(path)

  class ListModel(Gtk.TreeModelSort):
  __gtype_name__ = 'SugarListModel'



___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PROPOSAL] Inform the user when an activity is being installed and more

2013-01-14 Thread Manuel QuiƱones
2013/1/12  :
>> On Sat, Jan 12, 2013 at 4:31 PM, Agustin Zubiaga Sanchez > > wrote:
>>
>> > Hi everybody,
>> >
>> > Now, if we download or copy a .xo to the journal, it is installed
>> > automatically and doesn't informs to the user that the activity is being
>> > installed.
>> >
>>
>> Is this a change in 13.1.0? I think in the past we installed the activity
>> when was launched by first time.
>
> No, I don't think this is a recent change, its been this way for a long time. 
> Your question though is good because it illustrates the merit of the 
> proposal. The current behaviour is counter intuitive. Copying/downloading to 
> Journal installs but deleting from Journal does not uninstall. Strangely, 
> deleting from the Journal details view does uninstall or prevents the install 
> when you arrive there from 'show in journal'.
>
> Sugar should make the process understandable, not black box, I support the 
> proposal.

Yes, Sugar should behave better in XO installs, and I celebrate
Agustin proposal.

-- 
.. manuq ..
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] sdxo #310, #2769 adds ability to set a custom start/home page in Browse

2013-01-14 Thread Ariel Calzada
sdxo #310, #2769 this patch adds the ability to set a custom
 start/home page in Browse



---
 browser.py   |   26 +-
 hometoolbar.py   |   45 ++
 icons/browse-change-homepage.svg |   11 ++
 icons/browse-go-homepage.svg |   11 ++
 webactivity.py   |   13 +--
 webtoolbar.py|   14 +---
 6 files changed, 104 insertions(+), 16 deletions(-)
 create mode 100644 hometoolbar.py
 create mode 100644 icons/browse-change-homepage.svg
 create mode 100644 icons/browse-go-homepage.svg

diff --git a/browser.py b/browser.py
index 7419d2d..47be4c6 100644
--- a/browser.py
+++ b/browser.py
@@ -340,14 +340,38 @@ class TabbedView(BrowserNotebook):
 def load_homepage(self):
 browser = self.current_browser
 
-if os.path.isfile(_LIBRARY_PATH):
+if os.path.isfile(activity.get_bundle_path() + "/data/homepage.conf"):
+confFile = 
os.path.join(activity.get_bundle_path(),"data/homepage.conf")
+f = open(confFile,"r")
+contents = f.read().strip()
+f.close()
+
+if contents != "":
+default_page = contents
+else:
+default_page = 
os.path.join(activity.get_bundle_path(),"data/index.html")
+
+browser.load_uri(default_page)
+elif os.path.isfile(_LIBRARY_PATH):
 browser.load_uri('file://' + _LIBRARY_PATH)
 else:
 default_page = os.path.join(activity.get_bundle_path(),
 "data/index.html")
 browser.load_uri('file://' + default_page)
+
 browser.grab_focus()
 
+def change_homepage(self):
+""" Change data/homepage.conf with current URL
+"""
+confFile = 
os.path.join(activity.get_bundle_path(),"data/homepage.conf")
+index = self.get_current_page()
+ui_uri = self.get_nth_page(index).browser.get_uri()
+
+f = open ( confFile,"w")
+f.write(ui_uri)
+f.close()
+
 def _get_current_browser(self):
 if self.get_n_pages():
 return self.get_nth_page(self.get_current_page()).browser
diff --git a/hometoolbar.py b/hometoolbar.py
new file mode 100644
index 000..3d5e6a6
--- /dev/null
+++ b/hometoolbar.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2007, One Laptop Per Child
+# Copyright (C) 2012, Ariel Calzada
+#
+# 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 gettext import gettext as _
+from gi.repository import Gtk
+from sugar3.graphics.toolbutton import ToolButton
+
+class HomeToolbar(Gtk.Toolbar):
+def __init__(self, activity):
+Gtk.Toolbar.__init__(self)
+
+self._activity = activity
+
+self.gohome = ToolButton('browse-go-homepage')
+self.gohome.set_tooltip(_('Go to home page'))
+self.gohome.connect('clicked', self.__gohome_clicked_cb)
+self.insert(self.gohome, -1)
+self.gohome.show()
+
+self.changehome = ToolButton('browse-change-homepage')
+self.changehome.set_tooltip(_('Set current page as home page'))
+self.changehome.connect('clicked', self.__changehome_clicked_cb)
+self.insert(self.changehome, -1)
+self.changehome.show()
+
+def __changehome_clicked_cb(self, button):
+self._activity._change_home_button_cb(button)
+
+def __gohome_clicked_cb(self, button):
+self._activity._go_home_button_cb(button)
+
diff --git a/icons/browse-change-homepage.svg b/icons/browse-change-homepage.svg
new file mode 100644
index 000..c79c6d9
--- /dev/null
+++ b/icons/browse-change-homepage.svg
@@ -0,0 +1,11 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"; [
+  
+  
+]>
+http://www.w3.org/2000/svg"; width="55" height="55">
+  
+
+
+  
+
diff --git a/icons/browse-go-homepage.svg b/icons/browse-go-homepage.svg
new file mode 100644
index 000..a4fd762
--- /dev/null
+++ b/icons/browse-go-homepage.svg
@@ -0,0 +1,11 @@
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"; [
+  
+  
+]>
+http://www.w3.org/2000/svg"; width="55" height="55">
+  
+
+
+  
+
diff --git a/webactivity.py b/webactivity.py
index 3c0d337..0bbd9da 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -132,6 +132,7 @@ fro