Evt.TickCount() can be replaced by time.clock(), but I found no immediate replacement for Evt.WaitNextEvent(), so i changed the python script argv_emulator.py as described further down commenting away self._dooneevent(mask, timeout).
However, the easiest way to fix the problem is to edit the file /Contents/Info.plist by installing Xcode from App Store and use it as a .plist editor. Of course the Info.plist XML file can simply be edited using TextEdit.
<key>CFBundleExecutable</key> <string>argv_emulator.py</string> must be changed to <string>playonmac</string>
This will bypass the python script and start the app directly.
I also tried updating /Contents/MacOS/argv_emulator.py testing with Notepad++. I then got the python script to start the app but in neither of the two solutions the argument passing works, e.g. opening a file in the Finder context menu with "Open with" Notepad++ does launch Notepad++ but does not open the selected file.
import time
def mainloop(self, mask = highLevelEventMask, timeout = 1):
if len(sys.argv) > 1 and sys.argv[1][:4] == '-psn':
del sys.argv[1]
stoptime = time.clock() + timeout
while not self.quitting and time.clock() < stoptime:
# self._dooneevent(mask, timeout)
continue
# if not self.quitting:
# print "argvemulator: timeout waiting for arguments"
self.close()
Also the .app files must be moved to /System/Applications. They do not work residing on Desktop and will not work if moved to ~/Applications.