some proposals

觀看次數:4 次
跳至第一則未讀訊息

geor...@gmail.com

未讀,
2008年4月7日 下午5:34:037/4/2008
收件者︰ ijython
Some things that I would like to see is:

1) One constructor more for Jythonshell, taking as parametrs
(Properties props, Classloader cl) so as it could be embedded in user-
defined classloader and properties (as PythonInterpreter does). So
JythonShell() (the default classloader) could just call the above
contructor with tthe default options. This is easy.

2) the default action of completing parenthesis, could be smarter like
in most of the editors. It could complete it but, it could raise some
flags so as not to add another one if by mistake you type one. I don't
know the difficulty of that but most editors have such function.


An error:
Whenever you do "os." then exception happens
In [0]: osTraceback (innermost last):
(no code object) at line 0
In [0]: java.lang.NullPointerException
at org.python.modules.os.classDictInit(Unknown Source)
...........................

and the second time there isn't esception but it just have the three
default arguments

Kostas

Duncan Child

未讀,
2008年4月7日 下午6:03:167/4/2008
收件者︰ ijytho...@googlegroups.com
On Mon, Apr 7, 2008 at 4:34 PM, geor...@gmail.com <geor...@gmail.com> wrote:
>
> Some things that I would like to see is:
>
> 1) One constructor more for Jythonshell, taking as parametrs
> (Properties props, Classloader cl) so as it could be embedded in user-
> defined classloader and properties (as PythonInterpreter does). So
> JythonShell() (the default classloader) could just call the above
> contructor with tthe default options. This is easy.

We can do this or if you have a patch we will include it. Andrei - do
you feel like tackling this one?

>
> 2) the default action of completing parenthesis, could be smarter like
> in most of the editors. It could complete it but, it could raise some
> flags so as not to add another one if by mistake you type one. I don't
> know the difficulty of that but most editors have such function.

I agree the current implementation is annoying. I use it a lot and it
is different enough to Eclipse and IntelliJ that it constantly catches
me out. It would be better to remove it altogether than leave it like
it is.

Dan, Andrei do you have any thoughts on this?

Duncan

Andrei CRACIUN

未讀,
2008年4月8日 下午12:16:388/4/2008
收件者︰ ijytho...@googlegroups.com
Hi Duncan,

1. Sure, I will do the changes. The default constructor will call the second one with ClassLoader.getSystemClassLoader() and System.getProperties() as arguments. Am I right?

2. Regarding on the parenthesis issue to remove the autocomplete it's easy. If we should simulate the Eclipse behavior some more work should be done as I haven't found a quick and easy way to do this. Unfortunately I cannot estimate how long it will take to add this new feature.

Regards,
Andrei

geor...@gmail.com

未讀,
2008年4月9日 下午7:10:529/4/2008
收件者︰ ijython
Hi all,

On Apr 8, 7:16 pm, "Andrei CRACIUN" <andrei.craciun...@gmail.com>
wrote:
> Hi Duncan,
>
> 1. Sure, I will do the changes. The default constructor will call the second
> one with ClassLoader.getSystemClassLoader() and System.getProperties() as
> arguments. Am I right?
>
Yes this is what I would like. Thanks

> 2. Regarding on the parenthesis issue to remove the autocomplete it's easy.
> If we should simulate the Eclipse behavior some more work should be done as
> I haven't found a quick and easy way to do this. Unfortunately I cannot
> estimate how long it will take to add this new feature.
>
This definitely is trickier. I think the best for now is to be
removed.

> Regards,
> Andrei
>

Regarding the exception thing when you do import os;os.
Is it known bug, or I have misconfigured ijython?

Best Regards,
Kostas

geor...@gmail.com

未讀,
2008年4月12日 下午2:19:3312/4/2008
收件者︰ ijython
Hello again,

1) about the exception thing again, I forgot to mention that this
happens on Linux. I haven't tried in Windows. Perhaps this has
something to do with that, because it is in the os module
i paste the whole thing

In [0]: osTraceback (innermost last):
(no code object) at line 0
In [0]: java.lang.NullPointerException
at org.python.modules.os.classDictInit(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.python.core.PyJavaClass.initialize(Unknown Source)
at org.python.core.PyJavaClass.__dir__(Unknown Source)
at org.leo.shell.Autocompleter.autocomplete(Autocompleter.java:285)
at org.leo.shell.Autocompleter.keyPressed(Autocompleter.java:162)
at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:
233)
at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:
232)
at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:
232)
at java.awt.Component.processKeyEvent(Component.java:5996)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2799)
at java.awt.Component.processEvent(Component.java:5815)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:
1848)
at
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:
697)
at
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:
962)
at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:
834)
at
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:
661)
at java.awt.Component.dispatchEventImpl(Component.java:4282)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:
183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

In [0]: java.lang.NullPointerException: java.lang.NullPointerException
In [0]: .

Do you have any idea?

2) I there an easy way to disable/disappear the menu?

3) I noticed that the output from a command that prints a lot of stuff
in the console is really slow. For example
>>> for i in range(1000):
print i

takes to much time.

Do you have any idea why is this so?
Do you think that there could be some optimization on how the ijython
gets the output from the interpreter?


Best regards,
Kostas

Dan Dromereschi

未讀,
2008年4月14日 上午5:22:2214/4/2008
收件者︰ ijytho...@googlegroups.com
Hi,

For #2, you can use the toggleMenuBar() method in the ShellView class:

JythonShell js = new JythonShell();
js.getView().toggleMenuBar();

Regards,

Dan

geor...@gmail.com

未讀,
2008年4月14日 上午6:00:0214/4/2008
收件者︰ ijython
Thanks,

Regards,
Kostas

Andrei CRACIUN

未讀,
2008年4月14日 上午6:08:2714/4/2008
收件者︰ ijytho...@googlegroups.com
Hi,

I've added a new constructor having the required arguments. Unfortunately it is not very clear to me how should the ClassLoader be used. Should all classes be loaded with the new ClassLoader or only some of them (maybe the ones from org.python)? Please give me some more details on this issue.

Also regarding the "os." exception I've tracked it back to org.python package but I haven't figure yet what the problem is. I'll keep investigating and when I'll have any results I'll come back with them.

Regards,
Andrei

geor...@gmail.com

未讀,
2008年4月14日 上午10:55:2314/4/2008
收件者︰ ijython
PySysteState takes care of it if you call the method "initialize" with
one more argument (the classloader).
PySystemState.initialize(properties, new Properties(), new String[]
{}, classLoader);

In this situation the thing the user has to do is to add manually the
classpath entries with the packageManager with these two methods:
PySystemState.packageManager.addJar(....)
PySystemState.packageManager.addDirectory(...)

(also skip.cahe.dir should be false)

This is something user-defined and outside of jythonshell
However this is what I would like for more flexibility.

Thanks a lot,
Kostas

On Apr 14, 1:08 pm, "Andrei CRACIUN" <andrei.craciun...@gmail.com>
wrote:
> Hi,
>
> I've added a new constructor having the required arguments. Unfortunately it
> is not very clear to me how should the ClassLoader be used. Should all
> classes be loaded with the new ClassLoader or only some of them (maybe the
> ones from org.python)? Please give me some more details on this issue.
>
> Also regarding the "os." exception I've tracked it back to org.python
> package but I haven't figure yet what the problem is. I'll keep
> investigating and when I'll have any results I'll come back with them.
>
> Regards,
> Andrei
>
> On Mon, Apr 14, 2008 at 1:00 PM, georg...@gmail.com <georg...@gmail.com>
> wrote:
>
>
回覆所有人
回覆作者
轉寄
0 則新訊息