Re: Python+Glade+Gtk tutorial?

2015-03-16 Thread Jason Heeris
Warning: I'm only going to answer half of your questions :)

I haven't built any GTK2/3 app in a while, but hopefully others here can
address your other questions (although you might have better luck on the
Python/GTK mailing list when it comes to finding a good tutorial, etc.)

On 17 March 2015 at 03:13, Dave Farrance 
davefarra...@omitthisyahooandthis.co.uk wrote:
 A web-search told me that Glade seems to be most peoples choice (over
 QT-Designer) for a GUI builder.  So even though I use a KDE desktop
 (Kubuntu 14.10), I decided to try Glade.

In terms of toolkit bindings, (a) I prefer GTK, but (b) it's impossible to
tell what the greater proportion of people using one vs. the other is. Or
if they're wise to do so. Are there more Google hits/SO questions because
it's harder to use? Or because everyone loves to use it? (And so on...)

A recent comment on my SO answer to a similar question claims PyQT/PySide
is a good way to go, with a couple of links there you might find
interesting: http://stackoverflow.com/a/3290724/188535

I wouldn't stress over it though; you can give yourself a headache trying
to decide between frameworks you've never developed in. Try one, commit to
developing at least some proficiency in it, and then try the other.

 from gi.repository import Gtk, Gdk, GObject, Pango etc...

 ... I get, in effect, the libraries used in Gnome-3 even with python2?

Yes. The GTK and Python versions are independent. You can make GTK3 apps
with either Python 2 or 3. It's purely coincidence that Python 3 and GTK3
came out around the same time.

Going the other way, Gnome 3 still includes some GTK2 apps, but I think
you'd get little sympathy for starting a *new* app in GTK2 instead of 3.

 Am I on the right track now?  Glade is a good choice for GUI building? And
 even though I'm using Python2, I should be ignoring all examples turned up
 by searching for PyGTK because they all seem to be GTK+2 and obsolete?

Glade is good, although eventually you learn the lesson that it's not going
to give you 100% control over your UI — there are some things you are
better off doing in your app setup code.

And yes, I'd recommend ignoring anything labelled PyGTK.

— Jason
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Module/lib for controlling a terminal program using redrawing?

2015-03-14 Thread Jason Heeris
Yes, Paul Rubin had it right: I hadn't thought of the term screen
scraper, but that might help my searching.

On 15 March 2015 at 05:50, Terry Reedy tjre...@udel.edu wrote:

 Perhaps you can use the guts of a terminal emulation program, removing
the part that displays the interpreted stream (a 24 x 80 array) on the
screen.  Searching 'python terminal emulation' returns these

Thanks for those results. I also discovered that someone wrote a Python
ANSI terminal scraper originally for use with Nethack:
https://github.com/helgefmi/ansiterm (although it seems generic enough).

Cheers,
Jason
-- 
https://mail.python.org/mailman/listinfo/python-list


Module/lib for controlling a terminal program using redrawing?

2015-03-14 Thread Jason Heeris
I am trying to automate the use of some old, in-house terminal-based
programs that use screen redrawing for their interface. This includes
single line redrawing (eg. using '\r' and overwriting), complete screen
clearing, and fine-grained cursor movement and overwriting (probably not
all in the same program at the same time though).

Is there a module/library that can help me with this?

I know of pexpect, but that seems more oriented towards line-by-line
prompts that don't involve redraws (eg. login prompt, then password prompt
on a new line). Think instead of trying to automate applications like
emacs, aptitude or even nethack that redraw sections of the screen without
making the terminal scroll.

This automation requires more than just sending a set of keystrokes, but
also reading what is displayed on screen and making decisions based up on
that.

Is there a library that can abstract the received redrawing activity so I
don't have to even know if the application has, eg. used a carriage return
or some other kind of cursor movement? Is there a way to just ask if this
were to be run in an ANSI terminal, what would be in each cell?

Python 2 or 3 are both fine, external packages are fine, but it has to work
on Linux (eg. Ubuntu 14.04 or later, Debian Wheezy or later).

Any pointers appreciated.

Cheers,
Jason
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-08-06 Thread Jason Heeris

Jason Heeris added the comment:

 Python documentation never document all possible exceptions raised by a 
 method.

No, but clearly *some* exceptions are documented, and presumably there's some 
reasoning behind which are and aren't.

In this case, the NotImplemented error is there by design. It's not an 
incidental effect of something else. It's part of the API, and it's used to 
indicate a common error condition: that the compression format is not supported.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-08-05 Thread Jason Heeris

Jason Heeris added the comment:

@Ezio

I am pretty sure it was read(). I couldn't submit the file I used as an 
example, so I'll see if I can construct a minimal example to post here.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-08-05 Thread Jason Heeris

Changes by Jason Heeris jason.hee...@gmail.com:


Added file: http://bugs.python.org/file36279/Scheme.zip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-08-05 Thread Jason Heeris

Changes by Jason Heeris jason.hee...@gmail.com:


Added file: http://bugs.python.org/file36280/zftest.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-08-05 Thread Jason Heeris

Jason Heeris added the comment:

Okay, I've attached two files:

1. Scheme.zip, from issue 5701
2. zftest.py, a script that you run in the same dir as Scheme.zip to 
produce this:

$ python zftest.py 
Extracting: 1!SCHEME.Z64
Traceback (most recent call last):
  File zftest.py, line 8, in module
child_data = parent.read(zinfo)
  File /usr/lib/python2.7/zipfile.py, line 931, in read
return self.open(name, r, pwd).read()
  File /usr/lib/python2.7/zipfile.py, line 1006, in open
close_fileobj=should_close)
  File /usr/lib/python2.7/zipfile.py, line 530, in __init__
raise NotImplementedError(compression type %d (%s) % 
(self._compress_type, descr))
NotImplementedError: compression type 6 (implode)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-08-05 Thread Jason Heeris

Jason Heeris added the comment:

Sorry, that was run with Python 2.7.5+ on Ubuntu.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22046] ZipFile.read() should mention that it might throw NotImplementedError

2014-07-23 Thread Jason Heeris

New submission from Jason Heeris:

As per issue 5701, the zipfile.ZipFile.read() method will throw a 
NotImplementedError if the compression scheme is not supported. However, there 
is no mention of this possibility in the documentation for the read() method. I 
would suggest, say, Calling read() on a ZipFile that uses an unsupported 
compression scheme (eg. implode) will raise a NotImplementedError.

It looks like you can use the testzip() method to check that this won't happen 
(ie. after you open the file but before you extract an entry). If that is 
really the expected way to check for this kind of condition, it would be nice 
to mention that too (under either method).

--
assignee: docs@python
components: Documentation
messages: 223737
nosy: detly, docs@python
priority: normal
severity: normal
status: open
title: ZipFile.read() should mention that it might throw NotImplementedError
type: enhancement
versions: Python 2.7, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22046
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com