Hi Lucian,
My answers are below
El 29/08/13 15:06, Lucian Smith escribió:
Thanks for the detailed reply! It was quite helpful. I think I'm
finally over the initial 'what on earth is going on' hump--I ended up
running things from Eclipse, which seems to be working out fine, and
have managed to create a 'hello world' type plugin derived from a
simplified version of the pylint plugin. However, the --new-instance
flag is a very useful bit of information: thanks!
I'm glad you've found my info useful, if you have more questions please
don't doubt to ask them here.
And the shortcut caching in .spyder2/ was indeed the problem--removing
the out-of-date entries let the new ones take effect. I'm not sure if
this counts as a flaw in Spyder itself--should I open an issue about it?
I think this was fixed in 2.2.3. Please try it and if it doesn't work,
yep, please go ahead and open an issue for it.
My only other question would be: would there have been a good way to
discover the information you posted on my own? I assume as I get more
proficient at this, looking at the code itself will be more revealing,
but if there's a part of the code that would be helpful for me to look
at first, or if there are other flags like the '--help' flag that
would give any insight into the basics of what's going on, that'd be
great.
I don't know how easy it is to find this info by oneself, perhaps not
that much, but it's certainly there (on both bootstrap and spyder
--help's). You're welcome to contribute to our wiki to improve this
situation, if you want to.
I also have one important piece of insight to you. Spyder architecture
is very elegant (though not well documented) and works like this: all
plugins (i.e. the modules in the plugins dir) can access the main window
attrs (through self.main) and so they are able to communicate with each
other and save the window's state in their own attrs. Plugins are also
in charge of creating its own config page and saving/using the options
that appear there. Besides, each plugin embeds one or more widgets (the
ones present in the widgets dir), which belong to that plugin only and
which can only communicate with it.
Cheers,
Carlos
Thanks again!
-Lucian
On Mon, Aug 26, 2013 at 1:35 PM, Carlos Córdoba <[email protected]
<mailto:[email protected]>> wrote:
Hi Lucian,
Sorry for my very late answer. My comments and suggestions are below:
El 15/08/13 18:10, Lucian Smith escribió:
I am trying to get started on writing a plugin or two for
Spyder, and
I have a few questions. First, I see by searching around that
others
have been interested in a 'hello world' type plugin example
for Spyder
in the past, but nobody ever seems to actually have a working
copy of
one. Do any of you have one you put together? Barring that, the
thing to do seems to be to copy and modify the pylint plugin,
which
can work, but starts off a bit complicated. Are there particular
modules inside spyderlib/ that would also work as plugin examples,
were they to be renamed and moved to the plugin directory?
Perhaps easier than the pylint plugin is the breakpoints one
(p_breakpoints.py). Please take a look at it to start with a more
understandable plugin.
Inside spyderlib, you can look at all files in the plugins
directory. It contains the plugins that form the core of Spyder,
like the Editor, the Console or the Object Inspector, so they are
more complex and integrated with one another (than pylint or
breakpoints) but you could take some inspiration from them too.
Second, for anyone doing plugin development, how do you do your
debugging? So far, I've been editing the plugin from within
Spyder
itself, then shutting it down and re-launching (from
bootstrap.py).
This works OK, but when something goes wrong, the diagnostics are
minimal, and I lose my undo/redo history. And I can't run
'bootstrap.py' from another instance of Spyder, since this doesn't
seem to do anything (presumably since it sees Spyder is already
running). Do you just launch bootstrap.py from a different IDE
altogether? Any recommendations?
Yes, there is one important recommendation: use bootstrap.py with
the following option to open a second instance:
python bootstrap.py -- --new-instance
This is what we the developers use to test Spyder changes while
developing its code with Spyder itself. The -- in the middle is
used to separate the bootstrap.py options from the ones of Spyder
itself. Please read
python boostrap.py --help
to see how this works.
Without --new-instance, Spyder looks first for a running instance.
If it can find it and no file name is passed, then it just returns
to the prompt again. This is used by us to open python files on
the same instance.
Finally, I am running into a smallish issue, but due to #2
above, I
can't figure out what the problem is. If I change this line in
p_pylint.py:
self.register_shortcut(pylint_act, context="Pylint",
name="Run
analysis", default="F8")
to:
self.register_shortcut(pylint_act, context="Pylint",
name="Run
analysis", default="Ctrl+F9")
the shortcut will indeed change to F9. However, if I try
other things like:
self.register_shortcut(pylint_act, context="Pylint",
name="Run
analysis", default="Ctrl+F8")
And sometimes even changing it to F9 doesn't work, and it
keeps the
old F8. Is it caching the value somewhere? Is there a way I
can step
through what's going on?
Yes, the shortcut values are catched in ~/.spyder2/.spyder.ini
(look for the "shortcuts" section at the end).
Thank you!
-Lucian
Please keep posting here if you have more doubts and don't get
discouraged by our current lack of availability, I'll try to be
more responsive from now on. The thing is I had I terrible cold
last week and I was working with Pierre (our main contributor) to
release 2.2.3 too.
Cheers,
Carlos
--
You received this message because you are subscribed to the Google
Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:spyderlib%[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google
Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.