On Thu, Sep 9, 2010 at 5:35 PM, <jython-users-request@lists.sourceforge.net> wrote:
Send Jython-users mailing list submissions to
       jython-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
       https://lists.sourceforge.net/lists/listinfo/jython-users
or, via email, send a message with subject or body 'help' to
       jython-users-request@lists.sourceforge.net

You can reach the person managing the list at
       jython-users-owner@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Jython-users digest..."

Today's Topics:

  1. Re: Is there a simple and effective way to make something
     identify a recursive function call? (Cliff Hill)
  2. Re: cant find jythonc to create a jar (naman jain)
  3.  cant find jythonc to create a jar (Josh Juneau)


---------- Forwarded message ----------
From: Cliff Hill <xlorep@darkhelm.org>
To: Jim Baker <jbaker@zyasoft.com>
Date: Wed, 8 Sep 2010 13:29:23 -0700
Subject: Re: [Jython-users] Is there a simple and effective way to make something identify a recursive function call?
Thanks for the link Jim, I found it quite helpful. The final product of my decorator is:

# @type code org.darkhelm.showsort.server.Code
def tracer(code):
    """
    Simple decorator function that handles identification of recursion and the
    name of the current function to ShowSort. It must have the code parameter
    be set to the Java Code object that will be executing the function.
    """
    import sys

    def wrapAll(func):
        def wrappedFunc(*args, ** kwargs):
            top = sys._getframe(1)

            current = top

            while current.f_back:
                current = current.f_back
                if top.f_code == current.f_code:
                    code.recurse()          # Tell ShowSort that a recursion happened.
                    break

            code.pyFuncName = func.__name__ # Tell ShowSort the name of the function.

            return func(*args, ** kwargs)

        wrappedFunc.__doc__ = func.__doc__

        return wrappedFunc

    return wrapAll

This seems to do the job for me. I guess my problem was I was attempting to make a solution to this outside of Jython, where the solution was simpler inside Jython.

On Wed, Sep 8, 2010 at 8:50 AM, Jim Baker <jbaker@zyasoft.com> wrote:
Cliff,

You could use this recipe as a basis for something like this. The recipe is not at all general purpose (there was some controversy about its claims), but it does illustrate how you can introspect function frames without having to introduce another stack to record what's going on - that does work in a general fashion:

If you're interested in doing this sort of thing, I tend to favor the inspect module.

- Jim
--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org


---------- Forwarded message ----------
From: naman jain <namanvit@gmail.com>
To: jython-users@lists.sourceforge.net
Date: Thu, 9 Sep 2010 17:09:55 +0530
Subject: Re: [Jython-users] cant find jythonc to create a jar
> something like this..
> `jythonc --core --deep --jar appletdemo.jar SimpleApplet.py`
>
> But I cant figure out where is jythonc. I do not get anything like that

I understand jythonc has been taken off for the latest jython
releases. Could anyone give pointers
on how to create .jar with jython-2.5.2 .
I am kind of stuck with this. Thanks for any help.

-naman

Naman

You remind me of the first time I joined jython-mailing list.
I had come up with this same problem. Then nobody gave me a solution.

I found the solution by myself.
Then I posted an html file out here in the jython-mailing list.

I have worked on servlets too.
 
--
Sangeetha,
Research scholar,
Computer Science and Engineering,
IIT Madras
 


---------- Forwarded message ----------
From: Josh Juneau <juneau001@gmail.com>
To: Jython Users <jython-users@lists.sourceforge.net>
Date: Thu, 9 Sep 2010 07:05:15 -0500
Subject: [Jython-users] cant find jythonc to create a jar
Naman-

Maybe something like this would help you out:  http://www.enigmacurry.com/2009/05/20/distributing-jython-apps-in-a-single-jar-file/

Also, creating a JAR is covered in the jythonbook here:  http://jythonpodcast.hostjava.net/jythonbook/en/1.0/SimpleWebApps.html#distributing-via-standalone-jar
and on the wiki here:  http://wiki.python.org/jython/LearningJython#building-jars-some-samples

The creation of applets are not currently possible with the Jython 2.5.x release due to the absence of a utility such as jythonc...they will most likely become available again in a future release of Jython once integration with projects such as clamp (http://github.com/groves/clamp) has been completed.

Hope this helps.

Josh Juneau
juneau001@gmail.com
http://jj-blogger.blogspot.com
http://www.jythonpodcast.com
Twitter ID:  javajuneau



On Thu, Sep 9, 2010 at 6:39 AM, naman jain <namanvit@gmail.com> wrote:
> something like this..
> `jythonc --core --deep --jar appletdemo.jar SimpleApplet.py`
>
> But I cant figure out where is jythonc. I do not get anything like that

I understand jythonc has been taken off for the latest jython
releases. Could anyone give pointers
on how to create .jar with jython-2.5.2 .
I am kind of stuck with this. Thanks for any help.

-naman

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users



------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users