pl | 2 Mar 12:11

Import error: jar and commapi(rxtxcomm)

Hi, i have this problem:

Directory's structure of my application:

----myapplication.jar
--------Lib/
------------scan.py
------------string.py
------------othermodules.py
-------org.python.util (extract of jython.jar standalone)
-------lib-ext/
------------RXTXComm.jar (or commapi.jar)
------------other.jar

the Manifest file of myapplication.jar

Main-Class: org.python.util.jython
Class-Path: ../lib-ext/RXTXComm.jar ../lib-ext/other.jar


when i run this command: java -jar myapplication.jar scan.py
receive this error:

Traceback (innermost last):
  File "<console>", line 1, in ?
  File "/home/maverick/jythosbsl4.jar/Lib/scan$py.class", line 10, in ?
  File "/home/maverick/jythosbsl4.jar/Lib/serial/__init__$py.class", line 17, in ?
  File "/home/maverick/jythosbsl4.jar/Lib/serial/serialjava$py.class", line 8, in ?
ImportError: no module named gnu

gnu is a directory in the RXTXComm.jar package (gnu.io).
Manifest file of this package is empy.
This error is returned also when i copy the RXTXComm.jar (commapi.jar) in the java/lib/ext directory.


Other:

>>> from java.lang import System
>>> System.getProperty("java.class.path")
'/usr/lib/jvm/java-6-sun-1.6.0.03/lib:/usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib:/usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/ext'
>>> import sys
>>> sys.path
['', '/home/maverick/myapplication.jar/Lib', '/home/maverick/myapplication.jar/Lib', '__classpath__']

furthermore if i extarct RXTXComm.jar and manually i copy directory in the myapplication.jar and add __init__.py 

---myapplication.jar
--------Lib/
------------scan.py
------------string.py
------------othermodules.py
-------org.python.util (extract of jython.jar standalone)
-------gnu/
---------------__init__.py
---------------io/
---------------------__init__.py
---------------------CommPortIdentifier.class
---------------------Otherclass.class

I receive this error:

Errore:  'module' object has no attribute 'CommPortIdentifier'


//scan.py
import serial, sys
def scan():
    """scan for available ports. return a list of tuples (num, name)"""
    available = []
    for i in range(256):
        try:
            s = serial.Serial(i)
            available.append( (i, s.portstr))
            s.close()   #explicit close 'cause of delayed GC in java
        except Exception:
            pass
    return available

if __name__=='__main__':
    print "PATH: ", sys.path
    print "Found ports:"
    for n,s in scan():
        print "(%d) %s" % (n,s)

serialjava.py
import sys, os, string, gnu.io
.............
 enum = gnu.io.CommPortIdentifier.getPortIdentifiers()   //return error


Attention: from Eclipse IDE this application runs very well

Thanks
PL




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Adi katz | 3 Mar 11:39

newbie question

I am new to jython.
Can someone explain what is the status of the scripts under Lib ?
For example /email/Generator.py import locale module which does not exist...
( I tried to use a script that sends an email with attachment and got an error thrown...
 
 
Thanks
 
 

Adi

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
rachmat | 3 Mar 15:42
Picon

script python cgi with jython

dear all,

can u help me, to combine script python cgi with jython ?
any example ?

rachmat

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Frank Wierzbicki | 3 Mar 17:09
Picon
Gravatar

I'm working at Sun now

Hi all.  Sun has hired me to work on Jython full-time.  They also
hired Ted Leung as a Python advocate.  See:
http://www.infoworld.com/article/08/03/03/hirings-python_1.html and my
weblog: http://fwierzbicki.blogspot.com/2008/02/jythons-future-looking-sunny.html

-Frank

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Frank Cohen | 3 Mar 17:24

Re: I'm working at Sun now

Dear Frank:

Congratulations on getting hired by Sun. I am delighted to see this  
as recognition of the hard work you put into the Jython project. I am  
ex-Sun myself and can tell you that Sun's engineering culture will  
give you a stable and supportive base of resources to do wonderful  
things. Well done!

-Frank

On Mar 3, 2008, at 8:09 AM, Frank Wierzbicki wrote:

> Hi all.  Sun has hired me to work on Jython full-time.  They also
> hired Ted Leung as a Python advocate.  See:
> http://www.infoworld.com/article/08/03/03/hirings-python_1.html and my
> weblog: http://fwierzbicki.blogspot.com/2008/02/jythons-future- 
> looking-sunny.html
>
> -Frank
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Jython-users mailing list
> Jython-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Picon

Re: I'm working at Sun now

On Mon, Mar 3, 2008 at 6:09 PM, Frank Wierzbicki <fwierzbicki <at> gmail.com> wrote:
> Hi all.  Sun has hired me to work on Jython full-time.  They also
>  hired Ted Leung as a Python advocate.  See:
>  http://www.infoworld.com/article/08/03/03/hirings-python_1.html and my
>  weblog: http://fwierzbicki.blogspot.com/2008/02/jythons-future-looking-sunny.html
>
>  -Frank
>

I haven't been around jython for too long to know everybody, but this
looks like a good move for Sun and
hopefully for you. Congrats!

./alex
--
.w( the_mindstorm )p.

>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  Jython-users mailing list
>  Jython-users <at> lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/jython-users
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Picon

Re: I'm working at Sun now

Frank Wierzbicki wrote:
> Hi all.  Sun has hired me to work on Jython full-time.  They also
> hired Ted Leung as a Python advocate. 
Fantastic news for you and Jython ! Congratulations !

SB
>  See:
> http://www.infoworld.com/article/08/03/03/hirings-python_1.html and my
> weblog: http://fwierzbicki.blogspot.com/2008/02/jythons-future-looking-sunny.html
>
> -Frank
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Jython-users mailing list
> Jython-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
David Huebel | 3 Mar 20:35
Picon

Re: newbie question

On Mon, Mar 3, 2008 at 4:39 AM, Adi katz <adi.katz <at> easasoftware.com> wrote:
> Can someone explain what is the status of the scripts under Lib ?
> For example /email/Generator.py import locale module which does not exist...
> ( I tried to use a script that sends an email with attachment and got an
> error thrown...

The Lib/ directory contains all of Jython's standard library
functionality that is implemented in Python.  (Some functionality is
implemented in Java instead.)  Jython intends to provide a working
implementation of (almost?) all of the Python standard library, but it
isn't there yet.  It looks like this is one part that isn't completely
working:

>>> import email
>>> m = email.Message.Message()
>>> m.as_string()
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "/opt/jython2.2/Lib/email/Message.py", line 127, in as_string
  File "/opt/jython2.2/Lib/email/Generator.py", line 10, in ?
ImportError: no module named locale
>>>

As a user the best workaround might be to use the Java mail API.  I
don't know if library coverage should be filed as a bug... anyone?

- David

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Frank Wierzbicki | 3 Mar 21:02
Picon
Gravatar

Re: newbie question

On Mon, Mar 3, 2008 at 2:35 PM, David Huebel <davidhuebel <at> gmail.com> wrote:
> On Mon, Mar 3, 2008 at 4:39 AM, Adi katz <adi.katz <at> easasoftware.com> wrote:
>  > Can someone explain what is the status of the scripts under Lib ?
>  > For example /email/Generator.py import locale module which does not exist...
>  > ( I tried to use a script that sends an email with attachment and got an
>  > error thrown...
>
>  The Lib/ directory contains all of Jython's standard library
>  functionality that is implemented in Python.  (Some functionality is
>  implemented in Java instead.)  Jython intends to provide a working
>  implementation of (almost?) all of the Python standard library, but it
>  isn't there yet.  It looks like this is one part that isn't completely
>  working:
>
>  >>> import email
>  >>> m = email.Message.Message()
>  >>> m.as_string()
>  Traceback (innermost last):
>   File "<console>", line 1, in ?
>   File "/opt/jython2.2/Lib/email/Message.py", line 127, in as_string
>   File "/opt/jython2.2/Lib/email/Generator.py", line 10, in ?
>  ImportError: no module named locale
>  >>>
locale has at least a sham implementation in trunk, but it's pretty
new and won't be too likely to get into 2.2.  We are trying to get
better lib coverage for the next release, in fact there has been some
progress there already.  I'm don't think it makes sense to file bugs
against missing libraries at this point.  We pretty much know about
missing libraries.  Now patches that implement missing libraries would
get our attention :)

-Frank

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Neil Hughes | 3 Mar 20:17

Re: I'm working at Sun now

On 03/03/2008 16:09, Frank Wierzbicki wrote:
> Hi all.  Sun has hired me to work on Jython full-time.

Congratulations Frank :-)

I only occasionally use Jython, when it seems most suitable to the 
project at hand, but nevertheless it's great to see it getting this sort 
of backing.

--

-- 
Neil

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane