first, line 283 (filenames = ...) seems indented one tab too much:
> Error Loading Session: /home/jldamnet/.drpython/plugins/Sessions.DefaultSession.dsf
>
>
> Traceback (most recent call last):
> File "/home/jldamnet/.drpython/plugins/Sessions.py", line 287, in LoadSession
> l = len(filenames)
> UnboundLocalError: local variable 'filenames' referenced before assignment
then, after changing the above I was too fast to test and I closed DrPython with no file opened then relaunched it, and yep ! looks like it doesn't tolerate a session with no file:
> Error Loading Session: /home/jldamnet/.drpython/plugins/Sessions.DefaultSession.dsf
>
>
> Traceback (most recent call last):
> File "/home/jldamnet/.drpython/plugins/Sessions.py", line 289, in LoadSession
> if l > 0 and len(filenames[0] > 0):
> TypeError: len() of unsized object
cheers,
Jean
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think, there is an indentation error in line 283:
filenames = drPrefsFile.ExtractPreferenceFromText(text, "Files").rstrip().split('\n')
(this belongs 1 tab left)
line 289 should be changed to:
if l > 0 and len(filenames[0]) > 0:
The right brace were not right.
Franz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a bug with the find history:
It always saves the old, and not the new find and
replace strings.
I changed the autosave find section to:
if ignoreAuto or DrFrame.SESSIONPREFSautosavefind:
#Find
#Save with '\n\n\r\r\r\n' as the separator, to ensure newlines in
#the find history are properly stored.
#Well, at least make it probable.
f.write("<Find History>\n<Find>")
DrFrame.FindHistory = DrFrame.FindHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.FindHistory:
f.write(x + '\n\n\r\r\r\n')
f.write("</Find>\n<Replace>")
DrFrame.ReplaceHistory = DrFrame.ReplaceHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.ReplaceHistory:
f.write(x + '\n\n\r\r\r\n')
f.write("</Replace></Find History>\n")
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
arghh, the tabs problem again.
(I didn't changed it of course in the plugins, only on my
pc)
f.write("<Find History>\n<Find>")
DrFrame.FindHistory = DrFrame.FindHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.FindHistory:
->f.write(x + '\n\n\r\r\r\n')
f.write("</Find>\n<Replace>")
DrFrame.ReplaceHistory = DrFrame.ReplaceHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.ReplaceHistory:
->f.write(x + '\n\n\r\r\r\n')
f.write("</Replace></Find History>\n")
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Drpython opens with default session => you open anothter session. I think, this should not be saved
automatically as default session. Sooner as the last
opened session name. And/or have a menu: save as
default session.
2) If you open for example Mysession.dsf, it should
automatically (when exitting drPython) be saved as
Mysession.dsf or if you want to save it manually,
it should suggest in the save dialog MySession.dsf.
3) What about a cmd line parameter for start a
specific session? drpython.py -s=Mysession.dsf
4) What about the ability to bind shortcuts for Load/Save/Load Recent Sessions?
5) (I suggested Dan alreay)
Option in sessions preferences. Save Session Positions. After starting drpython with defaultsession or load session, I should jump to the last active tab
and in all Documents go to the last used/edited line.
(IMHO much more useful then save folding state)
Franz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think we should dissociate
- restoring the state of files "as it was when last closed"
- setting files in "session xyz" state
So when launching DrPython there could be a message "there were files opened last time you closed, want to re-open them ?" with 3 answers No/Yes/"Yes + make it a session"
Of course, that behavior would be controlled by setting a parameter "restore previous state on startup", while another (mutually exclusive) option would be "always restore in a specific state" with a choice box for a session file name, and probably a third option "always start empty"
I'm not sure about your suggestion in (2) as besides the files I need for a given project which are opened by that project session file, I also open other files (sometimes for a quick editing task unrelated to that project, or a quick Copy/Paste/Print from the browser to avoid printing dozens of pages to get a paragraph) and I surely don't want these extra files beeing "appended" to my session file.
But yes, I would definitely like your number 3, as I would certainly create several desktop icons to jump directly into this or that project...
Jean
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmmmm. What I suppose should happen is
we should split sessions into two plugins:
Sessions, which will only have the autosession
(which I am starting to grow fond of myself, only I'd like to speed things up a bit), and a Project Manager.
Then you can load projects, which would be like sessions, only with extra stuff.
What thoughts?
The binding shortcuts should go in, yes.
Also, for a project plugin, it would be simple enough to allow drpython to load drpython project files from the command line (.dpf .dpp .drpyproject?)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Project Manager : that's it, but I probably didn't dare spelling it's true name... YES PLEASE !
(and yes also to direct opening from the cmd line)
**=> note also the notion of project would allow dreaming of a refactoring plugin, working at the project level... Did someone try this Bicycle Repair Man that is listed in the tools on the refactoring.com site ? (Don't answer here, I'll put that question in a separate thread)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jean:
>I'm not sure about your suggestion in (2) as besides the files...
I meant, only to avoid, that accidentally saves
an opened session than as default session.
This had annoyed me sometimes already, that my
default session was lost then.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Franz,
Yes I understand that.
Anyway, if one or two files are "appended" to a project by mistake, they can easily be closed and the project file re-saved to clean it.
Jean
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sessions should now work with drpython 3.4.x
It would be great, to have an option, to remember:
- the last active document
- all line positions of the documents.
first, line 283 (filenames = ...) seems indented one tab too much:
> Error Loading Session: /home/jldamnet/.drpython/plugins/Sessions.DefaultSession.dsf
>
>
> Traceback (most recent call last):
> File "/home/jldamnet/.drpython/plugins/Sessions.py", line 287, in LoadSession
> l = len(filenames)
> UnboundLocalError: local variable 'filenames' referenced before assignment
then, after changing the above I was too fast to test and I closed DrPython with no file opened then relaunched it, and yep ! looks like it doesn't tolerate a session with no file:
> Error Loading Session: /home/jldamnet/.drpython/plugins/Sessions.DefaultSession.dsf
>
>
> Traceback (most recent call last):
> File "/home/jldamnet/.drpython/plugins/Sessions.py", line 289, in LoadSession
> if l > 0 and len(filenames[0] > 0):
> TypeError: len() of unsized object
cheers,
Jean
Looks like 1.0.5 is in short order then ;)
(When I get back from my trip)
Daniel, enjoy your trip, we can survive with 1.0.4 for now !
I agree with that!
I think, there is an indentation error in line 283:
filenames = drPrefsFile.ExtractPreferenceFromText(text, "Files").rstrip().split('\n')
(this belongs 1 tab left)
line 289 should be changed to:
if l > 0 and len(filenames[0]) > 0:
The right brace were not right.
Franz
import drScrolledMessageDialog
was missing
There is a bug with the find history:
It always saves the old, and not the new find and
replace strings.
I changed the autosave find section to:
if ignoreAuto or DrFrame.SESSIONPREFSautosavefind:
#Find
#Save with '\n\n\r\r\r\n' as the separator, to ensure newlines in
#the find history are properly stored.
#Well, at least make it probable.
f.write("<Find History>\n<Find>")
DrFrame.FindHistory = DrFrame.FindHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.FindHistory:
f.write(x + '\n\n\r\r\r\n')
f.write("</Find>\n<Replace>")
DrFrame.ReplaceHistory = DrFrame.ReplaceHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.ReplaceHistory:
f.write(x + '\n\n\r\r\r\n')
f.write("</Replace></Find History>\n")
arghh, the tabs problem again.
(I didn't changed it of course in the plugins, only on my
pc)
f.write("<Find History>\n<Find>")
DrFrame.FindHistory = DrFrame.FindHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.FindHistory:
->f.write(x + '\n\n\r\r\r\n')
f.write("</Find>\n<Replace>")
DrFrame.ReplaceHistory = DrFrame.ReplaceHistory[-DrFrame.SESSIONPREFSfindhistory:]
for x in DrFrame.ReplaceHistory:
->f.write(x + '\n\n\r\r\r\n')
f.write("</Replace></Find History>\n")
Franz, when Daniel is back, he will be able to jump Sessions several version levels in a single step ;-))
cheers,
Jean
Yes ;)
What about:
1) Drpython opens with default session => you open anothter session. I think, this should not be saved
automatically as default session. Sooner as the last
opened session name. And/or have a menu: save as
default session.
2) If you open for example Mysession.dsf, it should
automatically (when exitting drPython) be saved as
Mysession.dsf or if you want to save it manually,
it should suggest in the save dialog MySession.dsf.
3) What about a cmd line parameter for start a
specific session? drpython.py -s=Mysession.dsf
4) What about the ability to bind shortcuts for Load/Save/Load Recent Sessions?
5) (I suggested Dan alreay)
Option in sessions preferences. Save Session Positions. After starting drpython with defaultsession or load session, I should jump to the last active tab
and in all Documents go to the last used/edited line.
(IMHO much more useful then save folding state)
Franz
I think we should dissociate
- restoring the state of files "as it was when last closed"
- setting files in "session xyz" state
So when launching DrPython there could be a message "there were files opened last time you closed, want to re-open them ?" with 3 answers No/Yes/"Yes + make it a session"
Of course, that behavior would be controlled by setting a parameter "restore previous state on startup", while another (mutually exclusive) option would be "always restore in a specific state" with a choice box for a session file name, and probably a third option "always start empty"
I'm not sure about your suggestion in (2) as besides the files I need for a given project which are opened by that project session file, I also open other files (sometimes for a quick editing task unrelated to that project, or a quick Copy/Paste/Print from the browser to avoid printing dozens of pages to get a paragraph) and I surely don't want these extra files beeing "appended" to my session file.
But yes, I would definitely like your number 3, as I would certainly create several desktop icons to jump directly into this or that project...
Jean
Hmmmm. What I suppose should happen is
we should split sessions into two plugins:
Sessions, which will only have the autosession
(which I am starting to grow fond of myself, only I'd like to speed things up a bit), and a Project Manager.
Then you can load projects, which would be like sessions, only with extra stuff.
What thoughts?
The binding shortcuts should go in, yes.
Also, for a project plugin, it would be simple enough to allow drpython to load drpython project files from the command line (.dpf .dpp .drpyproject?)
Project Manager : that's it, but I probably didn't dare spelling it's true name... YES PLEASE !
(and yes also to direct opening from the cmd line)
**=> note also the notion of project would allow dreaming of a refactoring plugin, working at the project level... Did someone try this Bicycle Repair Man that is listed in the tools on the refactoring.com site ? (Don't answer here, I'll put that question in a separate thread)
Jean:
>I'm not sure about your suggestion in (2) as besides the files...
I meant, only to avoid, that accidentally saves
an opened session than as default session.
This had annoyed me sometimes already, that my
default session was lost then.
Franz,
Yes I understand that.
Anyway, if one or two files are "appended" to a project by mistake, they can easily be closed and the project file re-saved to clean it.
Jean