Bug 532635 - Review Request: rurple - A Python Learning Environment
Summary: Review Request: rurple - A Python Learning Environment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-03 08:45 UTC by Paulo Roma Cavalcanti
Modified: 2009-11-08 18:59 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-11-08 18:59:47 UTC
Type: ---
Embargoed:
gwync: fedora-review+
kevin: fedora-cvs+


Attachments (Terms of Use)

Description Paulo Roma Cavalcanti 2009-11-03 08:45:43 UTC
Spec URL: http://orion.lcg.ufrj.br/RPMS/SPECS/rurple.spec

SRPM URL: http://orion.lcg.ufrj.br/RPMS/src/rurple-1.0-0.1.rc3.fc10.src.rpm

Description:

With the assistance of a robot named Reeborg, one can explore
the fun of programming in the Python language.
A "Python Learning Environment" is a Python implementation of
a "robot environment" as introduced by R. Pattis in 1981.
RUR is similar in spirit to GvR, although it uses Python syntax.
It also includes a Python shell.

Koji scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=1784662

rpmlint is not clean because internal scripts with extension .rur, .wld, and
html files are requested to have a shebang. 
All these files are in /usr/share/rurple.

Comment 1 Gwyn Ciesla 2009-11-03 15:13:23 UTC
First look:

There are end-of-line encoding errors on several .htm and .css files, please fix.

There are also .rur and .wld files set executable with no shebang, they should be chmodded -x unless they really need to be executable.

In build and install, it would be better to use a python macro, see the numpy spec, including the first few lines thereof.

In the desktop-file install, don't add the Application category.

Mock build is in progress, but will probably be fine as it's noarch.

Comment 2 Gwyn Ciesla 2009-11-03 15:26:54 UTC
Mock build was good.

Comment 3 Paulo Roma Cavalcanti 2009-11-03 16:09:17 UTC
Fixed.

Spec URL: http://orion.lcg.ufrj.br/RPMS/SPECS/rurple.spec

SRPM URL: http://orion.lcg.ufrj.br/RPMS/src/rurple-1.0-0.2.rc3.fc10.src.rpm

rpmlint is clean now.

Comment 4 Gwyn Ciesla 2009-11-03 16:19:48 UTC
The default file save location is the same as the default file open location.  The user won't have write access there, and it fails silently.  Is there a place in .rurple that could be used?  If not, patch to default to the user's home if possible.

Comment 5 Paulo Roma Cavalcanti 2009-11-03 17:47:36 UTC
Generally, people want to save in the same directory where the file has been read from. If I patch to save in /home, it will always save there, even if the file has been read from a user directory.

I can check if it is the first time, that is, the user has just typed a program (has not read it from anywhere):

The same thing would have to be done for saving the world. 
The file /usr/bin/rur_start.py would have a test like the one below,
which uses a new variable init_dir. What do you think?

def SaveProgramFile(self, dummy):
        if self.isRunning:
            return
        global code
        code = self.ProgramEditor.GetText()
        no_error, mesg = parser.ParseProgram(code)
        if no_error:
            wildcard = _("Program files (*.rur)|*.rur| All files (*.*)|*.*")
            fname = os.path.basename(self.filename)

            if ( self.filename == "" ):
                 init_dir = os.environ.get('HOME')
            else:
                 init_dir = misc.PRGM_DIR

            dlg = wx.FileDialog(self, _("Save new program as"), init_dir,
                               fname, wildcard, wx.SAVE| wx.CHANGE_DIR )

Comment 6 Gwyn Ciesla 2009-11-03 18:06:00 UTC
Issues from full review: 
See #4.

License tag should be GPLv2+
Should really be named rur-ple IMHO.  The tarball is rurple, but the project is rur-ple.  It's up to you, just my $0.02.
Otherwise it looks good.

Re: #5

You could always make a copy or the base material to a hidden folder in the user's home, so they'd each have their own copy.  Check out cylindrix in CVS and see what's been done there.

Assuming my reading of your code snippet is correct, you might not even need to do that.

Comment 7 Paulo Roma Cavalcanti 2009-11-03 23:59:40 UTC
Jon,

I did what you asked: I created an script that copies the data
to .rurple. Same URLs.

Regarding the package name, I do not know. It seems easier for
me to remember "yum install rurple", than having an extra "-" in the name.

But we can choose the name at the end of the revision.

Comment 8 Gwyn Ciesla 2009-11-04 14:39:26 UTC
Whoops forgot the flag.

Comment 9 Gwyn Ciesla 2009-11-04 15:26:42 UTC
Hmm. Now it won't start:

Line 43, No such file or directory, rur_images

Comment 10 Paulo Roma Cavalcanti 2009-11-04 15:32:31 UTC
Have you deleted your old ~/.rurple directory?

The first time, we need to create the links.

Comment 11 Gwyn Ciesla 2009-11-04 15:40:24 UTC
No, I haven't.  Shouldn't the script check for the links in the .rurple directory, and remove and recreate if they aren't present?

Comment 12 Paulo Roma Cavalcanti 2009-11-04 15:47:42 UTC
I just copied the cylindrix script, and that was I did not like.
If everything is working for you, I can improve the script, by testing 
each individual link separately.

Comment 13 Paulo Roma Cavalcanti 2009-11-04 16:02:03 UTC
This is the new /usr/bin/rurple script:

-----------------------------------------------------------------------


#!/bin/bash

#if no .rurple in home
if [ ! -d ~/.rurple ]; then
  #make .rurple in home
  mkdir ~/.rurple || :
fi

#link to data
if [ ! -d ~/.rurple/lessons ]; then
  ln -s /usr/share/rurple/lessons ~/.rurple/lessons || :
fi
if [ ! -d ~/.rurple/python_files ]; then
  ln -s /usr/share/rurple/python_files ~/.rurple/python_files  || :
fi
if [ ! -d ~/.rurple/rur_images ]; then
  ln -s /usr/share/rurple/rur_images ~/.rurple/rur_images || :
fi
if [ ! -d ~/.rurple/rur_locale ]; then
  ln -s /usr/share/rurple/rur_locale ~/.rurple/rur_locale || :
fi

#copy mutable data
if [ ! -d ~/.rurple/rur_programs ]; then
  cp -R -p /usr/share/rurple/rur_programs ~/.rurple/ || :
fi
if [ ! -d ~/.rurple/world_files ]; then
  cp -R -p /usr/share/rurple/world_files ~/.rurple/ || :
fi

cd ~/.rurple
exec /usr/bin/rur_start.py "$@"

Comment 14 Gwyn Ciesla 2009-11-04 16:15:23 UTC
Not at the old link yet.  I'd like to test it. :)

Comment 16 Gwyn Ciesla 2009-11-04 17:28:40 UTC
Brilliant!  All of the above fixed, I respect your judgment on the name.

APPROVED.

Comment 17 Paulo Roma Cavalcanti 2009-11-05 11:47:24 UTC
Thanks Jon, for the fast review and the valuable suggestions.


New Package CVS Request
=======================
Package Name: rurple
Short Description: A Python Learning Environment
Owners: roma
Branches: F-10 F-11 F-12
InitialCC: roma

Comment 18 Kevin Fenzi 2009-11-06 20:27:55 UTC
cvs done.


Note You need to log in before you can comment on or make changes to this bug.