Fischx / wmii

Automatically exported from code.google.com/p/wmii
MIT License
0 stars 0 forks source link

More Python 2.6.3(?) issues #140

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- Define terminal in wmiirc_local.py:
terminal = 'wmiir', 'setsid', 'uxterm'
- Define a monitor function in wmiirc_local.py which uses call():
@defmonitor
def netz(self):
    return call('iwgetid', '-r')

What is the expected output? What do you see instead?
Both are not working on the Python 2.6.3 machine that also suffered from
issue #132. Terminal is still xterm and the monitor function is not updating.
On another machine using Python 2.6.2, everything is fine.

What version of the product are you using (wmii -v)? On what operating
system?
hg2558

Please provide any additional information below.

Original issue reported on code.google.com by skwi...@googlemail.com on 20 Oct 2009 at 7:19

GoogleCodeExporter commented 9 years ago
When you define terminal like that, you're only updating it in the wmiirc_local
package. You need to do something like this:

    import wmiirc
    wmiirc.terminal = 'wmiir', 'setsid', 'uxterm'

(although I recommend urxvt). I've never used the uxterm script, anyway. It's 
easier
to just add this to ~/.Xdefaults:

    *locale: true

As for the monitor, do any other monitors work? Do any monitors which use call()
work? Does `iwgetwid -r` work on its own?

Original comment by maglion...@gmail.com on 20 Oct 2009 at 10:12

GoogleCodeExporter commented 9 years ago
Strangely setting the terminal as I did works on that Python 2.6.2 machine, 
although
your explanation looks valid.

As for the monitors, I tried a few using call(), none worked. I wanted to try
os.popen() as a workaround next, but do not have that Python 2.6.3 machine 
around now.

Original comment by skwi...@googlemail.com on 21 Oct 2009 at 7:35

GoogleCodeExporter commented 9 years ago
And yes, "iwgetid -r" works on its own.

Original comment by skwi...@googlemail.com on 21 Oct 2009 at 7:37

GoogleCodeExporter commented 9 years ago
To be clear: iwgetid -r also works in the monitor function, but it only shows 
the
value from starting wmii, it is never updated.

Sorry for flooding this issue with comments.

Original comment by skwi...@googlemail.com on 21 Oct 2009 at 7:54

GoogleCodeExporter commented 9 years ago
Ok, I solved the call() issue: The monitor function (or the thing that uses its
return value) does not like the empty string iwgetid returns when no ESSID is 
there.
Then the old value is kept. This fixes it:

@defmonitor()
def netz(self):
    netz = call('iwgetid', '-r')
    if netz == '':
        netz = 'no wifi'
    return netz

I do think, however, that empty strings should be allowed.

Original comment by skwi...@googlemail.com on 21 Oct 2009 at 7:04

GoogleCodeExporter commented 9 years ago
They should, but that's a long standing bug. The FS internals ignore empty 
writes
because some clients (like p9p's 9p(1)) send an empty write at the end of their 
data,
which clobbers the previous ones if it's not ignored.

Original comment by maglion...@gmail.com on 21 Oct 2009 at 7:26