Jython Monthly |
|
February 2007 -- Issue #8 |
Welcome to the February 2007 issue of Jython Monthly. The content of this newsletter will focus on using and developing the Jython languge. I want to encourage the readers of Jython Monthly to send any articles, tips, tricks, or any other Jython related material to me if you think it should be distributed with this newsletter.
There has been quite a bit of activity in the past couple of months within the Jython community. Jython development has been quite active, Jython 2.2 Beta 1 has been released, and the user base is also growing. As a whole, the CPython language and all of its implementations are actively growing more each day. As such is the case, this year's PyCon event is sure to be a worthy event. I would like to encourage all reader's that live near Dallas or have the ability to travel to attend this event. It will be held Feb 23-25 in Addison Texas. For more information, please visit the PyCon 2007 home page.
Special thanks to those who submitted material for this month's newsletter!
- Josh Juneau
Questions, comments, or suggestions?
Please send email to:
jython-monthly@mchsi.com or jython-users@lists.sourceforge.net for discussion.
News
Welcome the most recent release of the Jython scripting language, Jython 2.2 Beta 1! This represents a major milestone in the life cycle of the Jython scripting language as this is the first release since the summer of 2005. The Jython developer and user community is extremely active right now and I predict that the gap between future releases will be much smaller.
Thanks to the developers for working hard on this release! Now it is up to the user community to test and give feedback for Beta 1. Download it now and get started!!
Articles
Adding JARs to sys.path During Runtime
Submitted By: Steve Langer
During Oct-Nov 2006 there was a thread in the jython-users group titled "adding JARs to sys.path". More accurately the objective there was to add JARs to the sys.path at runtime. Several people asked the question, "Why would you want to do that?" Well there are at least 2 good reasons. First, if you want to distribute a jython or Java package that includes non-standard Jars in it. Perhaps you want to make life easier for the target user and not demand that they know how to set environment variables. A second even more compelling reason is when there is no normal user account to provide environment variables.
Off The Lists
Question From Luca Cassioli:
- I need I have a function "waiting in background" for an event to be triggered. Can it be done from console, or should I write a script? In other words, I want to port such a source to Jython: import javax.telephony.*; import javax.telephony.events.*;
The MyInCallObserver class implements the CallObserver and
- recieves all Call-related events.
public class MyInCallObserver implements CallObserver {
public void callChangedEvent(CallEv[] evlist) { [....] [handle event] }
import MyInCallObserver; [....] try {
- Terminal terminal = myprovider.getTerminal("1234567890");
terminal.addCallObserver(new MyInCallObserver());
- System.out.println("Can’t get Terminal: " + excp.toString()); System.exit(0);
Answer From Jeff Emanuel:
see http://www.jython.org/Project/userguide.html#a-short-example
Direct translation:
# imports omitted class MyInCallObserver(CallObserver):
- def callChangedEvent(self, evList):
- # handle event ...
try:
- terminal = myprovider.getTerminal('1234567890')
terminal.addCallObserver(MyInCallObserver())
except java.lang.Exception, ex:
- print "Can't get terminal " + ex.toString() System.exit(0)
Or try the bean events technique (http://www.jython.org/Project/userguide.html#event-properties):
def handleCall(evList):
- # handleEvent
try:
- terminal = myprovider.getTerminal('1234567890') terminal.callChangedEvent=handleCall
except java.lang.Exception, ex:
- print "Can't get terminal " + ex.toString() System.exit(0)
Interested in Developing Jython?
If you are interested in developing Jython, please take a look at the current bug listing and submit patches for items which you can repair.
Tips and Tricks
Python Cookbook: BaseHTTPServer with Socket Timeout
Python Cookbook: Generator for an arbitrary number of 'for' loops
Python Cookbook: Another generator for an arbitrary number of 'for' loops
Jython Blogs
Jython Roadmap -- Frank Wierzbicki
Jython 2.2 - Beta 1 Released -- Frank Wierzbicki
Jython 2.2 Beta 1 -- Josh Juneau
GUESS: A cool graph visualization application using Jython
Jython 2.2 Hits Major Milestone -- Push To Test
IDE
Pydev and Pydev Extensions 1.2.6 have been released
Details on Pydev Extensions: http://www.fabioz.com/pydev
Details on Pydev: http://pydev.sf.net
Details on its development: http://pydev.blogspot.com
Discussions
Connect to Java RMI Server from Jython
Extended Repository Service & Jython Scripting
Discussion Submitted by Thomas Muller -- Second Notice
Hello jython users,
I want to suggest a new project, but need your help. There is an open source python written serverless instant messenger out (based on a kademlia DHT lookup for buddies):
Version 1.26 (though the icons in version 1.24 are better). As well a linux porting exists. http://www.aabdalla.com/releases/
I want to initiate a project to port the python messenger to java using jython. But I cannot do it alone. We could register a sf.net project for "cspace-java". Is jython ready to just compile it and get a jar out and a source-file out? Can someone send this through jython or help?
The server is serverless and this means independence from any central instance. It uses to identify the buddy a RSA-Key and a CSpace-ID from the developer-server. In the long run, only the RSA-Key should be used. Unfortunatly you cannot a) create an RSA-key without that central server and b) you cannot launch the application without the Cspace-ID.
Anyway, we can use it with the tachyon server for creation, but communication and buddy-lookup is decentral and encrypted like skype as well.
But what we need is a java version. Maybe the cspace developers did not played around with jython either, and instead of coding windows and Linux or MacOSX port, we can switch to interoperable java.
But as there are less resources, I want to ask the mailinglist of jython to fix the current status of the application over jython to java please.
The serverless Messenger in java could be easily built in into many applications, which need an instant messenger:
- yacy.net - serverless p2p webindex search engine in java - sf.net/projects/antsp2p - already a jeti-jabber buddylist integrated for bootstrapping, but it is central. - limewire.com of course - azureus.sf.net of course - wikisari, the google pendant, still under development http://lists.wikia.com/pipermail/search-l/2006-December/000004.html
Does anyone agree on that potentials? kind regards tom
Interesting Facts
Jython - Average Job Salary & Stats in UK http://www.itjobswatch.co.uk/jobs/uk/jython.do
Useful Links
The IBM® Jacl to Jython Conversion Assistant (Jacl2Jython) is a program that assists in converting WebSphere® administrative (wsadmin) scripts written in Jacl into Jython syntax.