Re: Good luck with the hips

2014-06-15 Thread Viktor Ransmayr
Good luck  a speedy recovery !

With kind regards,

Viktor

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Good luck with the hips

2014-06-15 Thread Kent Tenney
+1

All the best Edward !

Thanks,
Kent

On Sun, Jun 15, 2014 at 3:23 AM, Viktor Ransmayr
viktor.ransm...@gmail.com wrote:
 Good luck  a speedy recovery !

 With kind regards,

 Viktor

 --
 You received this message because you are subscribed to the Google Groups
 leo-editor group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to leo-editor+unsubscr...@googlegroups.com.
 To post to this group, send email to leo-editor@googlegroups.com.
 Visit this group at http://groups.google.com/group/leo-editor.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Support for Qt5 has begun

2014-06-15 Thread 'Terry Brown' via leo-editor

PyQt5 conversion seems mostly straight forward, apart from the parts
that are not straight forward :-}

Trying to work out what's going on in todo.py, let's use a simple test
case, just running the 'insert-icon' command on an outline with a
single node.

'insert-icon' uses g.app.gui.runOpenFileDialog, and *Py*Qt 5 has changed the 
return value for QFileDialog.getOpenFileNames() from 
  [list of file names]
to
  [[list of file names], selected filter]

Ok, no big deal.

Here's a trap though:

-def setter(pri=pri): o.setPri(pri)
-self.connect(w, QtCore.SIGNAL(clicked()), setter)
+def setter(pri=pri):
+o.setPri(pri)
+if isQt5:
+w.clicked.connect(setter)
+else:
+self.connect(w, QtCore.SIGNAL(clicked()), setter)

The old form calls setter() with no parameters, the new form calls
setter with `bool is_checked`, seeing buttons can be checked or
unchecked when they're clicked.

I think the best solution is to change setter() to be
  def setter(checked, pri=pri): ...
which will work in both Qt4 and Qt5, basically the old style .connect()
let you select whether that parameter got passed or not, but I think
everything's cleaner if we just make the callbacks match the basic
definition of the signals.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Terry, please check todo.py with PyQt5

2014-06-15 Thread 'Terry Brown' via leo-editor
On Sat, 14 Jun 2014 13:20:01 -0500
'Terry Brown' via leo-editor leo-editor@googlegroups.com wrote:

 On Sat, 14 Jun 2014 10:19:44 -0700 (PDT)
 Edward K. Ream edream...@gmail.com wrote:
 
  I made a number of changes, but not enough, it seems.  todo works
  with PyQt4 but not 5.  For example, icons don't appear in headlines.
 
 I'll take a look when I can.
 
 todo.py doesn't work with Python 3, well, it does, but it can't read
 datetime objects pickled in 2.x, which is annoying.  I have not been
 able to find any 3.x code that will read a 2.7 datetime pickle,
 although maybe I haven't tried in 3.4, I think there were some changes
 in pickle recently.
 
 Current plan is to have todo.py convert dates to string
 representations in 2.x, and report files that need running through 2.x
 when they're encountered in 3.x

Woohoo - finally found a way around this, there's a special encoding
`bytes` that can be used, at least in 3.4, not sure about earlier 3.x
series.

-g.trace('can not unpickle %s=%s' % (attr,val))
-return val
+try:
+# for python 2.7 in python 3.4
+val2 = pickle.loads(binString, encoding='bytes')
+return val2
+except 
(pickle.UnpicklingError,ImportError,AttributeError,ValueError,TypeError):
+g.trace('can not unpickle %s=%s' % (attr,val))
+return val

Cheers -Terry

 Cheers -Terry
 

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Terry, please check todo.py with PyQt5

2014-06-15 Thread Edward K. Ream
On Sun, Jun 15, 2014 at 12:01 PM, 'Terry Brown' via leo-editor
leo-editor@googlegroups.com wrote:

 Woohoo - finally found a way around this, there's a special encoding
 `bytes` that can be used, at least in 3.4, not sure about earlier 3.x
 series...
val2 = pickle.loads(binString, encoding='bytes')

Cool.  Thanks for working on this.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.