Jeff Epler | 2 Mar 18:12 2009
Picon

The wiki -- spammers and permission to edit

The wiki has been seeing a ton of spam since I upgraded to a modern
version of moin (isn't that ironic! perhaps I should downgrade again).

Simply requiring users to sign in before editing has also not proven to
be enough.

I am stuck with Ubuntu Hardy Heron's version of moin, so I can't enable
advanced features like TextCha that are in the newest versions of moin.
(I am using BadContent and LocalBadContent, but those are useless
against the current kind of spam which consist of creating a new page
and then putting the actual spam in an attachment to the page!)

Therefore, I've chosen to implement a whitelist of approved editors.
Create a wiki account if you don't have one yet, and I'll add you to the
page ApprovedEditorsGroup.  (actually, anyone who is an approved editor
can edit this page, and I've added all people who edited pages since
2005).

I'm open to better suggestions, again with the caveat that I'm stuck on
hardy heron's version of moin, 1.5.8-5.1ubuntu2.2.  I'm also open to
anyone who is able to take over the wiki and do a better job at
technical countermeasures than me, or an initiative to move the
information on it to the common Python wiki.

I'm sorry for the inconvenience this will cause for everyone who would
like to contribute to the wiki.

Jeff
Allen Taylor | 2 Mar 21:59 2009

Announcement: Tka11y initial release - Accessibility-aware Tkinter

The initial version of Tka11y is released. You can find it at http://pypi.python.org/pypi/Tka11y.
 
From the package description...
 
This module makes it possible for accessibility (a11y) clients (e.g., audible readers, magnifiers, etc.) to get accessibility data (name, description, role, actions, etc.) from the Tk widgets of Python applications that use Tkinter. It also allows automated GUI application testers that use the accessibility interface (such as dogtail, LDTP, and Accerciser) to control the Tk widgets of these applications.
 
Currently, accessibility is only available via ATK <=> AT-SPI on Linux. Sorry, no Windows MSAA support.
 
Enjoy!
 
Allen B. Taylor
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Kevin Walzer | 2 Mar 23:14 2009

Re: The wiki -- spammers and permission to edit


> 
> I'm sorry for the inconvenience this will cause for everyone who would
> like to contribute to the wiki.
> 

Jeff,

I'm sorry that these measures are necessary too, but the spam appears to 
be out of control--this is a prudent response to that.

Thanks for all you to do keep the wiki running--it's an invaluable 
resource.

Best,
Kevin

--

-- 
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Madhu Subramaniam | 3 Mar 17:09 2009
Picon

Tkinter: window manager- .resizable

Hello,

I work with python 2.5.2 and i use Tkinter for a gui app development. Platform with which i work is:- Linux version 2.6.9-67.ELsmp (brewbuilder <at> hs20-bc1-5.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-8))

#!/usr/local/bin/python
#----------------------
from Tkinter import *
import pdb
import os
import string
import threading
from tkFileDialog import *
from tkMessageBox import *
import sys

main_w = Tk()
main_w.resizable(width = False, height = False)
#main_w.maxsize(width= 1000, height = 3000)
print main_w.resizable()
main_w.mainloop()

In the above code the command main_w.resizable.... does not work. That means, the user can drag the window to a larger size but cannot make the same smaller.

On printing:
-------------
print main_w.resizable()

i do get 0,0 as output!

BUT,  the resizable attribute works  if i add the following line
main_w.maxsize(width= 1000, height = 3000)
where the values are random but should not be set to width = 0, height =0, in which case it (widget.resizable(width = False, height = False)) does not function.


So is this a bug, or am i doing something wrong here ? :O

Regards
Thanks
arms

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Michael Lange | 3 Mar 20:06 2009
Picon

Re: Tkinter: window manager- .resizable

On Tue, 3 Mar 2009 17:09:21 +0100
Madhu Subramaniam <madhu.subramaniam <at> gmail.com> wrote:

> Hello,
> 
> I work with python 2.5.2 and i use Tkinter for a gui app development.
> Platform with which i work is:- Linux version 2.6.9-67.ELsmp (
> brewbuilder <at> hs20-bc1-5.build.redhat.com) (gcc version 3.4.6 20060404 (Red
> Hat 3.4.6-8))**
> 
> #!/usr/local/bin/python
> #----------------------
> from Tkinter import *
> import pdb
> import os
> import string
> import threading
> from tkFileDialog import *
> from tkMessageBox import *
> import sys
> 
> main_w = Tk()
> main_w.resizable(width = False, height = False)
> #main_w.maxsize(width= 1000, height = 3000)
> print main_w.resizable()
> main_w.mainloop()
> 
> In the above code the command main_w.resizable.... does not work. That
> means, the user can drag the window to a larger size but cannot make the
> same smaller.
> 
> On printing:
> -------------
> print main_w.resizable()
> 
> i do get 0,0 as output!
> 
> BUT,  the resizable attribute works  if i add the following line
> main_w.maxsize(width= 1000, height = 3000)
> where the values are random but should not be set to width = 0, height =0,
> in which case it (widget.resizable(width = False, height = False)) does not
> function.
> 
> 
> So is this a bug, or am i doing something wrong here ? :O
> 
> Regards
> Thanks
> arms
> 

I cannot verify this here (Python2.5.2 on debian etch). Which version of Tk and which Wm do you use?

Michael
Guilherme Polo | 3 Mar 20:55 2009
Picon

Re: Tkinter: window manager- .resizable

On Tue, Mar 3, 2009 at 1:09 PM, Madhu Subramaniam
<madhu.subramaniam <at> gmail.com> wrote:
> Hello,
>
> I work with python 2.5.2 and i use Tkinter for a gui app development.
> Platform with which i work is:- Linux version 2.6.9-67.ELsmp
> (brewbuilder <at> hs20-bc1-5.build.redhat.com) (gcc version 3.4.6 20060404 (Red
> Hat 3.4.6-8))
>
> #!/usr/local/bin/python
> #----------------------
> from Tkinter import *
> import pdb
> import os
> import string
> import threading
> from tkFileDialog import *
> from tkMessageBox import *
> import sys
>
> main_w = Tk()
> main_w.resizable(width = False, height = False)
> #main_w.maxsize(width= 1000, height = 3000)
> print main_w.resizable()
> main_w.mainloop()
>
> In the above code the command main_w.resizable.... does not work. That
> means, the user can drag the window to a larger size but cannot make the
> same smaller.
>
> On printing:
> -------------
> print main_w.resizable()
>
> i do get 0,0 as output!

Note that "resizable" is an alias to wm_resizable. All these methods
starting with wm_ actually mean: "Please window manager, can you, if
you don't mind, and if you are feeling like a good wm, do this favor
-- insert favor here -- for this window? Please ?". And there is no
guarantee that every wm will answer "yes".

>
> BUT,  the resizable attribute works  if i add the following line
> main_w.maxsize(width= 1000, height = 3000)
> where the values are random but should not be set to width = 0, height =0,
> in which case it (widget.resizable(width = False, height = False)) does not
> function.
>
>
> So is this a bug, or am i doing something wrong here ? :O
>
> Regards
> Thanks
> arms
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss <at> python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
>

--

-- 
-- Guilherme H. Polo Goncalves
Iain Day | 16 Mar 22:50 2009

Filling a series of tk.Label

Hi,

I've written a short program which is supposed to populate a table 
constructed from tk.Label widgets. It does this by looping over the 
rows. Unfortunately, it only seems to populate the final row. What am I 
doing wrong?

The code is:

def updatedata():
     updatetime.delete(0, tk.END)
     for i in range(len(machines)):
         print machines[i]
         status = sshshowstat(machines[i])

         for j in range(len(status)):
             param, value = status[j].split(': ')

             for k in range(len(variables)):
                 if re.match(variables[k], param) is None:
                     continue
                 else:
#                    print i, value
                     if value in ('Acquiring', 'Regulated'):
                         systemdata[i][k].config(text=value, 
foreground='green')
                     elif value in ('Not Reg.'):
                         systemdata[i][k].config(text=value, 
foreground='red')
                     else:
                         systemdata[i][k].config(text=value)

tk.Button(root, text="Update Table Data", 
command=updatedata).grid(row=len(machines)+1, column=len(variables), 
sticky=tk.S)

Thanks,

Iain
Michael O'Donnell | 17 Mar 09:55 2009
Picon
Picon

Re: Filling a series of tk.Label

Iain,

  You code is incomplete, the place where you create the Label widgets
is not included. We need that to see the problem.

Check the grid operation on each Label, in particular the row parameter.

Also, do a print as each Label is gridded, to see if they all are
actually created.

Mick

On Mon, Mar 16, 2009 at 10:50 PM, Iain Day
<iain <at> day-online.org.uk.invalid> wrote:
> Hi,
>
> I've written a short program which is supposed to populate a table
> constructed from tk.Label widgets. It does this by looping over the rows.
> Unfortunately, it only seems to populate the final row. What am I doing
> wrong?
>
> The code is:
>
> def updatedata():
>    updatetime.delete(0, tk.END)
>    for i in range(len(machines)):
>        print machines[i]
>        status = sshshowstat(machines[i])
>
>        for j in range(len(status)):
>            param, value = status[j].split(': ')
>
>            for k in range(len(variables)):
>                if re.match(variables[k], param) is None:
>                    continue
>                else:
> #                    print i, value
>                    if value in ('Acquiring', 'Regulated'):
>                        systemdata[i][k].config(text=value,
> foreground='green')
>                    elif value in ('Not Reg.'):
>                        systemdata[i][k].config(text=value, foreground='red')
>                    else:
>                        systemdata[i][k].config(text=value)
>
>
> tk.Button(root, text="Update Table Data",
> command=updatedata).grid(row=len(machines)+1, column=len(variables),
> sticky=tk.S)
>
>
>
> Thanks,
>
> Iain
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss <at> python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
Iain Day | 17 Mar 19:26 2009

Re: Filling a series of tk.Label

Sorry, here is the code that makes the label widgets:

systemdata = [[0]*len(headers)]*len(machines)

for i in range(len(machines)):
     for j in range(len(headers)):
         systemdata[i][j] = tk.Label(root, text=' ')
         systemdata[i][j].grid(row=i+1, column=j+1)

If I do the following:

systemdata[1][2].config(text='Test')

It puts "Test" into position [2][2] rather than [1][2]. It appears to 
only "see" the last row ([2]).

Iain

Michael O'Donnell wrote:
> Iain,
> 
>   You code is incomplete, the place where you create the Label widgets
> is not included. We need that to see the problem.
> 
> Check the grid operation on each Label, in particular the row parameter.
> 
> Also, do a print as each Label is gridded, to see if they all are
> actually created.
> 
> Mick
> 
> On Mon, Mar 16, 2009 at 10:50 PM, Iain Day
> <iain <at> day-online.org.uk.invalid> wrote:
>> Hi,
>>
>> I've written a short program which is supposed to populate a table
>> constructed from tk.Label widgets. It does this by looping over the rows.
>> Unfortunately, it only seems to populate the final row. What am I doing
>> wrong?
>>
>> The code is:
>>
>> def updatedata():
>>    updatetime.delete(0, tk.END)
>>    for i in range(len(machines)):
>>        print machines[i]
>>        status = sshshowstat(machines[i])
>>
>>        for j in range(len(status)):
>>            param, value = status[j].split(': ')
>>
>>            for k in range(len(variables)):
>>                if re.match(variables[k], param) is None:
>>                    continue
>>                else:
>> #                    print i, value
>>                    if value in ('Acquiring', 'Regulated'):
>>                        systemdata[i][k].config(text=value,
>> foreground='green')
>>                    elif value in ('Not Reg.'):
>>                        systemdata[i][k].config(text=value, foreground='red')
>>                    else:
>>                        systemdata[i][k].config(text=value)
>>
>>
>> tk.Button(root, text="Update Table Data",
>> command=updatedata).grid(row=len(machines)+1, column=len(variables),
>> sticky=tk.S)
>>
>>
>>
>> Thanks,
>>
>> Iain
>>
>> _______________________________________________
>> Tkinter-discuss mailing list
>> Tkinter-discuss <at> python.org
>> http://mail.python.org/mailman/listinfo/tkinter-discuss
>>
Madhu Subramaniam | 17 Mar 20:44 2009
Picon

Re: Filling a series of tk.Label

Iain,
 
I made a small test program (Fairly new in Tkinter), i have not found the solution but i came across something, maybe somebody can throw more light on this ?
 
Test Code (Active Python IDE 2.6 , Windows XP, Tkinter 8.4)
 
import sys
import pdb
from Tkinter import *
headers='ll'
machines= 'zt'
lbl = [[0]*len(headers)]*len(machines)
flag=0
root = Tk()
for i in range(len(machines)):
   for j in range(len(headers)):
    lbl[i][j] = Label(root, text= str(i)+str(j), bg = 'red')
    lbl[i][j].grid(row=i, column=j, padx=10, pady =5)
print lbl # something that was noticed
#print lbl[0][1]
lbl[0][0].config(text= 'row=0, column=0') # changes the text in lbl [1] [0]
lbl[0][1].config(text= 'row=0, column=1') # changes the text in lbl [1] [0]
lbl[1][0].config(text= 'row=1, column=0')# overwrites the text in lbl [1] [0]
lbl[1][1].config(text= 'row=1, column=1') # overwrites the text in lbl [1] [0]
root.mainloop()
 
OUTPUT
>>> [[<Tkinter.Label instance at 0x012B3B70>, <Tkinter.Label instance at 0x012B3AA8>], [<Tkinter.Label instance at 0x012B3B70>, <Tkinter.Label instance at 0x012B3AA8>]]
 
The instances generated in row wise are the same, but within a row they are different...
something more can be learnt from that?? hmm, i got to leave now.
 
Thanks
Madhu

 
On Tue, Mar 17, 2009 at 9:55 AM, Michael O'Donnell <michael.odonnell <at> uam.es> wrote:
Iain,

 You code is incomplete, the place where you create the Label widgets
is not included. We need that to see the problem.

Check the grid operation on each Label, in particular the row parameter.

Also, do a print as each Label is gridded, to see if they all are
actually created.

Mick

On Mon, Mar 16, 2009 at 10:50 PM, Iain Day
<iain <at> day-online.org.uk.invalid> wrote:
> Hi,
>
> I've written a short program which is supposed to populate a table
> constructed from tk.Label widgets. It does this by looping over the rows.
> Unfortunately, it only seems to populate the final row. What am I doing
> wrong?
>
> The code is:
>
> def updatedata():
>    updatetime.delete(0, tk.END)
>    for i in range(len(machines)):
>        print machines[i]
>        status = sshshowstat(machines[i])
>
>        for j in range(len(status)):
>            param, value = status[j].split(': ')
>
>            for k in range(len(variables)):
>                if re.match(variables[k], param) is None:
>                    continue
>                else:
> #                    print i, value
>                    if value in ('Acquiring', 'Regulated'):
>                        systemdata[i][k].config(text=value,
> foreground='green')
>                    elif value in ('Not Reg.'):
>                        systemdata[i][k].config(text=value, foreground='red')
>                    else:
>                        systemdata[i][k].config(text=value)
>
>
> tk.Button(root, text="Update Table Data",
> command=updatedata).grid(row=len(machines)+1, column=len(variables),
> sticky=tk.S)
>
>
>
> Thanks,
>
> Iain
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss <at> python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Gmane