gitso

gitso Commit Details


Date:2009-08-16 17:27:40 (15 years 4 months ago)
Author:gerberad
Branch:master
Commit:3a7c15a928b922d25f269d338e1cf86154800bf5
Parents: a55e00cc690eae3e0a9887783528c023637ef86e
Message:arch/win32/setup.py - Added metadata about the app.

ArgsParser.py
- Cleaned up imports and updated year

ConnectionWindow.py
- Update threadlocking. in setMessage() if the lock is already set, the method returns so it doesn't freeze.
- Also removed the argument from self.CreateStatusBar().

makegitso.nsi
- Added win32api.pyd

Processes.py
- Added development mode for Windows Processes.
Changes:

File differences

gitso/trunk/ArgsParser.py
4141
4242
4343
44
4445
4546
4647
......
5455
5556
5657
58
59
5760
5861
5962
......
6265
6366
6467
65
66
68
6769
6870
6971
self.paths['listen'] = False
self.paths['connect'] = ''
self.paths['list'] = []
self.paths['mode'] = ''
if sys.platform.find('linux') != -1:
i = 1
while i < len(sys.argv):
if sys.argv[i] == '--dev': # --dev
print "Running in 'Development Mode'"
self.paths['mode'] = 'dev'
if sys.platform == "darwin":
if not os.path.exists('build/OSXvnc'):
os.popen("mkdir build; cp arch/osx/OSXvnc.tar.gz build ; cd build ; tar xvfz OSXvnc.tar.gz > /dev/null")
if not os.path.exists('build/cotvnc.app'):
os.popen("cp arch/osx/cotvnc.app.tar.gz build ; cd build ; tar xvfz cotvnc.app.tar.gz > /dev/null")
self.paths['resources'] = 'build/'
elif sys.platform == "w32":
print "dev mode"
elif sys.platform == "win32":
self.paths['main'] = os.path.join(sys.path[0])
self.paths['copyright'] = os.path.join(sys.path[0], 'COPYING')
self.paths['resources'] = 'arch/win32/'
gitso/trunk/ConnectionWindow.py
125125
126126
127127
128
128
129129
130130
131131
......
256256
257257
258258
259
260
261
262
263
264
265
266
267259
268260
269
261
262
263
264
270265
271266
272267
273268
274269
275270
276
277
278
279
271
280272
281273
282274
......
310302
311303
312304
305
306
307
313308
314309
315310
311
316312
317313
318314
319315
320316
321317
318
322319
323320
324321
......
328325
329326
330327
331
332
333
328
329
334330
335331
336332
337333
338334
339
335
336
340337
self.SetMenuBar(menuBar)
self.statusBar = self.CreateStatusBar(1)
self.statusBar = self.CreateStatusBar()
self.statusBar.SetStatusWidths([350])
self.setMessage("Idle", False)
@author: Derek Buranen
@author: Aaron Gerber
"""
"""
def kill(pid):
""kill function for Win32""
import win32api
handle = win32api.OpenProcess(1, 0, pid)
return (0 != win32api.TerminateProcess(handle, 0))
"""
if self.thread <> None:
self.thread.kill()
time.sleep(.5)
# If you don't wait 0.5+ seconds, the interface won't reload and it'll freeze.
# Possibly on older systems you should wait longer, it works fine on mine...
# With better thread management, I'm not sure that we need this. If we start getting freezes, look at this.
# time.sleep(1)
self.thread = None
self.setMessage("Idle.", False)
return
def OnCloseWindow(self, evt):
if self.thread <> None:
self.thread.kill()
time.sleep(.5)
self.thread = None
self.KillPID()
self.Destroy()
self.hostField.SetValue(text)
def setMessage(self, message, status):
if self.threadLock.locked():
return
self.threadLock.acquire()
self.statusBar.SetStatusText(message, 0)
if status:
self.connectButton.Enable(False)
self.stopButton.Enable(True)
else:
self.connectButton.Enable(True)
self.stopButton.Enable(False)
if self.ToggleValue == 0:
self.rb1.SetValue(True)
self.threadLock.release()
def createThread(self, host=""):
if self.thread <> None:
self.thread.kill()
self.thread = GitsoThread.GitsoThread(self, self.paths)
self.KillPID()
self.thread = GitsoThread.GitsoThread(self, self.paths)
self.thread.setHost(host)
self.thread.start()
# If you don't wait 1+ seconds, the interface won't reload and it'll freeze.
# Possibly on older systems you should wait longer, it works fine on mine...
time.sleep(1)
# With better thread management, I'm not sure that we need this. If we start getting freezes, look at this.
# time.sleep(1)
gitso/trunk/Processes.py
4343
4444
4545
46
46
47
48
49
50
4751
4852
4953
......
5660
5761
5862
59
63
64
65
66
67
68
6069
6170
6271
......
7685
7786
7887
79
8088
8189
8290
print "Launched WinVNC.exe, waiting to run -connect command..."
import time
time.sleep(3)
subprocess.Popen(['WinVNC.exe', '-connect', '%s' % host])
if self.paths['mode'] == 'dev':
subprocess.Popen(['%sWinVNC.exe' % self.paths['resources'], '-connect', '%s' % host])
else:
subprocess.Popen(['WinVNC.exe', '-connect', '%s' % host])
else:
print 'Platform not detected'
return self.returnPID
elif sys.platform.find('linux') != -1:
self.returnPID = os.spawnlp(os.P_NOWAIT, 'vncviewer', 'vncviewer', '-bgr233', '-listen')
elif sys.platform == 'win32':
self.returnPID = subprocess.Popen(['vncviewer.exe' , '-listen'])
import subprocess
print self.paths['resources']
if self.paths['mode'] == 'dev':
self.returnPID = subprocess.Popen(['%svncviewer.exe' % self.paths['resources'], '-listen'])
else:
self.returnPID = subprocess.Popen(['vncviewer.exe', '-listen'])
else:
print 'Platform not detected'
return self.returnPID
handle = win32api.OpenProcess(PROCESS_TERMINATE, False, self.returnPID.pid)
win32api.TerminateProcess(handle, -1)
win32api.CloseHandle(handle)
print "vnc is dead, handles closed."
else:
os.kill(self.returnPID, signal.SIGKILL)
self.returnPID = 0
gitso/trunk/arch/win32/setup.py
1
12
23
3
4
45
56
6
7
7
8
9
10
11
12
13
814
915
10
11
import glob
from distutils.core import setup
import py2exe
import urllib
DATA_FILES = []
OPTIONS = {'argv_emulation': True}
setup(name="Gitso",
windows=["Gitso.py"],
setup(
version = "0.6.0",
description = "Gitso is to support Others",
name="Gitso",
windows=[{"script":"Gitso.py", "icon_resources":[(1,"icon.ico")]}],
data_files=[(".", ["icon.ico"])],
py_modules = ['AboutWindow', 'ConnectionWindow', 'ArgsParser', 'GitsoThread', 'Processes'],
)
gitso/trunk/makegitso.nsi
6767
6868
6969
70
7071
7172
7273
File ".\COPYING"
File ".\dist\Gitso.exe"
File ".\dist\bz2.pyd"
File ".\dist\win32api.pyd"
File ".\dist\icon.ico"
File ".\dist\library.zip"
File ".\dist\msvcp71.dll"

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.08137s using 13 queries.