gitso

gitso Commit Details


Date:2010-02-03 23:48:23 (14 years 10 months ago)
Author:gerberad
Branch:master
Commit:ae351872bee32c6ffae7645d1f094321ec468d39
Parents: 2ef7e83453f2996744fb021f60bbb886958210e8
Message:Disabled NATPMP on Windows. It wasn't working on Windows 7, so I just shut it off.

Changes:

File differences

gitso/trunk/ConnectionWindow.py
8484
8585
8686
87
87
88
89
8890
8991
9092
......
134136
135137
136138
137
138139
139140
140141
......
161162
162163
163164
164
165
166
165167
166168
167169
168
170
171
169172
170173
171174
self.Bind(wx.EVT_RADIOBUTTON, self.RadioToggle, id=self.rb2.GetId())
# checkbox for natpmp
self.cb1 = wx.CheckBox(self, -1, 'Use NAT-PMP', (130, 48))
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
self.cb1 = wx.CheckBox(self, -1, 'Use NAT-PMP', (130, 48))
self.cb1.Enable(False)
# the combobox Control
self.SetDefaultItem(self.hostField)
self.hostField.SetFocus()
self.cb1.Enable(False)
self.SetThemeEnabled(True)
self.Centre()
if self.rb1.GetValue():
self.ToggleValue = 0
self.hostField.Enable(True)
self.cb1.Enable(False)
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
self.cb1.Enable(False)
else:
self.ToggleValue = 1
self.hostField.Enable(False)
self.cb1.Enable(True)
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
self.cb1.Enable(True)
def ConnectSupport(self, event):
gitso/trunk/GitsoThread.py
2626
2727
2828
29
29
30
31
3032
3133
3234
......
5759
5860
5961
60
61
62
62
63
64
65
6366
6467
6568
......
9598
9699
97100
98
99
100
101
102
101
102
103
104
105
106
103107
104108
105109
......
143147
144148
145149
146
147
148
149
150
151
152
153
154
155
156
157
158
159
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
160166
import threading, time
import os, sys, signal, os.path
import Processes
import NATPMP
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
import NATPMP
class GitsoThread(threading.Thread):
def __init__(self, window, paths):
self.error = True
else:
# Give Support
self.window.cb1.Enable(False)
if self.window.cb1.GetValue() == True:
self.NATPMP('request')
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
self.window.cb1.Enable(False)
if self.window.cb1.GetValue() == True:
self.NATPMP('request')
self.pid = self.process.giveSupport()
time.sleep(.5)
@author: Aaron Gerber
"""
if self.window.rb1.GetValue() == False: #give support
if self.window.cb1.GetValue() == True:
self.NATPMP('giveup')
self.window.cb1.Enable(True)
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
if self.window.rb1.GetValue() == False: #give support
if self.window.cb1.GetValue() == True:
self.NATPMP('giveup')
self.window.cb1.Enable(True)
self.process.KillPID()
self.pid = 0
self.running = False
@author: Dennis Koot
"""
if action == 'request':
lifetime = 3600
print "Request port 5500 (NAT-PMP)."
else:
lifetime = 0
print "Give up port 5500 (NAT-PMP)."
pubpriv_port = int(5500)
protocol = NATPMP.NATPMP_PROTOCOL_TCP
gateway = NATPMP.get_gateway_addr()
try:
print NATPMP.map_port(protocol, pubpriv_port, pubpriv_port, lifetime, gateway_ip=gateway)
except:
print "Warning: Unable to automap port."
if sys.platform == 'darwin' or sys.platform.find('linux') != -1:
if action == 'request':
lifetime = 3600
print "Request port 5500 (NAT-PMP)."
else:
lifetime = 0
print "Give up port 5500 (NAT-PMP)."
pubpriv_port = int(5500)
protocol = NATPMP.NATPMP_PROTOCOL_TCP
try:
gateway = NATPMP.get_gateway_addr()
print NATPMP.map_port(protocol, pubpriv_port, pubpriv_port, lifetime, gateway_ip=gateway)
except:
print "Warning: Unable to automap port."

Archive Download the corresponding diff file

Branches

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