Changes between Initial Version and Version 1 of Ticket #201


Ignore:
Timestamp:
06/02/12 09:04:13 (10 years ago)
Author:
Antoine Martin
Comment:

If the check for a terminated process is what you say it should be, shouldn't the new python code be:

    started = parts[1]!="-"

Instead of "==" ?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #201

    • Property Owner changed from Antoine Martin to Antoine Martin
    • Property Status changed from new to accepted
  • Ticket #201 – Description

    initial v1  
    1 In trying to get a !WinSwitch/xpra server on Ubuntu to work with a !WinSwitch/xpra client on OSX, I had to fight with xmodmap a bit (need to use Alt for Eclipse, emacs, etc.).  I found the check for running X server not to be quite right.  The following diff is for an older version of winswitch/client/client_base.py (I can't use the latest due to https://xpra.org/trac/ticket/92), so the lines aren't current but their content hasn't changed.
     1In trying to get a !WinSwitch/xpra server on Ubuntu to work with a !WinSwitch/xpra client on OSX, I had to fight with xmodmap a bit (need to use Alt for Eclipse, emacs, etc.).  I found the check for running X server not to be quite right.  The following diff is for an older version of winswitch/client/client_base.py (I can't use the latest due to #92), so the lines aren't current but their content hasn't changed.
    22
    3 The first change fixes the search of lines for "org.x.startx".  In the old form, line.find returns -1 for any line without a match, triggering on the very first line ("PID     Status  Label").  Python documentation states a preference for "substring in string", when the position of substring in string is not needed.  If you want to insist on "org.x.startx" at the very end of the line, the test could be: if line.endswith("org.x.startx"):
     3The first change fixes the search of lines for "org.x.startx".  In the old form, line.find returns -1 for any line without a match, triggering on the very first line ("{{{PID  Status  Label}}}").  Python documentation states a preference for "substring in string", when the position of substring in string is not needed.  If you want to insist on "{{{org.x.startx}}}" at the very end of the line, the test could be: {{{if line.endswith("org.x.startx"):}}}
    44
    5 The second change corrects the check for a process that's running now ("0" in parts![1] appears to indicate that the process has terminated and returned 0).  Checking that parts![0] is NOT "-" is a valid check for a running process, as well.  The man pages are a bit vague.
     5The second change corrects the check for a process that's running now ("0" in {{{parts[1]}}} appears to indicate that the process has terminated and returned 0).  Checking that {{{parts[0]}}} is NOT "-" is a valid check for a running process, as well.  The man pages are a bit vague.
    66
    77The changes below work on my !MacBookPros at home and at work with 10.5 and 10.6: