Skip to content

Commit

Permalink
+ Added support for Python Tools for Visual Studio
Browse files Browse the repository at this point in the history
~ Modified ctypes module for embedded python
  • Loading branch information
Jonathan White committed Jul 1, 2013
1 parent f56bcca commit 8612812
Show file tree
Hide file tree
Showing 16 changed files with 3,991 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
Expand All @@ -31,8 +30,7 @@ nosetests.xml

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

python.log
gphashes.txt
*.suo
46 changes: 46 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>GES</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
<filteredResources>
<filter>
<id>1340314261030</id>
<name></name>
<type>5</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-*.py</arguments>
</matcher>
</filter>
<filter>
<id>1340314261045</id>
<name></name>
<type>6</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-wingdbstub.py</arguments>
</matcher>
</filter>
<filter>
<id>1340314261061</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-GESource</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions .pydevproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/python</path>
<path>/python/lib/pydev</path>
<path>/python/lib/python2.6</path>
</pydev_pathproperty>

</pydev_project>
2 changes: 1 addition & 1 deletion GESInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def SetPaths():

# Append each directory that we want to look in for modules
sys.path.append( PY_BASE_DIR )
sys.path.append( PY_BASE_DIR + "/lib/pydev" )
sys.path.append( PY_BASE_DIR + "/lib/" )
sys.path.append( PY_BASE_DIR + "/lib/python2.6" )

def LoadManager( name ):
Expand Down
2 changes: 1 addition & 1 deletion GamePlay/CaptureTheKey.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with GoldenEye: Source's Python Library.
# If not, see <http://www.gnu.org/licenses/>.
#############################################################################
from GamePlay import GEScenario, GEScenarioHelp
from . import GEScenario, GEScenarioHelp
from Utils import OppositeTeam, _
from Utils.GEOvertime import GEOvertime
from Utils.GETimer import EndRoundCallback, TimerTracker, Timer
Expand Down
Binary file added lib/GESource/gesource.zip
Binary file not shown.
23 changes: 21 additions & 2 deletions lib/pydev/ge_pydevd.py → lib/ge_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@
# along with GoldenEye: Source's Python Library.
# If not, see <http://www.gnu.org/licenses/>.
#############################################################################
import pydevd_constants
from pydev import pydevd_constants
pydevd_constants.DEBUG_TRACE_LEVEL = -1
pydevd_constants.DEBUG_TRACE_BREAKPOINTS = -1
pydevd_constants.USE_PSYCO_OPTIMIZATION = False

PTVS_SECRET = "ges"

# ----NOTES----
# pydevd_comm: a timeout was added to the StartClient function
# pydevd_comm: A better debug output was put into place around line 270 in ReaderThread.OnRun

import pydevd, GEUtil
import GEUtil

def ConnectDebugger( host_ovr=None, port_ovr=None ):
'''
Connect a listening Eclipse debugger
'''
from pydev import pydevd

if pydevd.connected:
GEUtil.Warning( "In order to run another debug session you MUST restart the game.\n" )
return
Expand All @@ -39,3 +46,15 @@ def ConnectDebugger( host_ovr=None, port_ovr=None ):

GEUtil.Msg( "Python debugger successfully connected!\n" )

def ListenDebugger( port_ovr=None ):
'''
Start a debug server for Python Tools for Visual Studio (ptvs)
'''
import ptvsd

if port_ovr:
ptvsd.enable_attach( secret=PTVS_SECRET, address=('0.0.0.0', port_ovr), redirect_output=False )
else:
ptvsd.enable_attach( secret=PTVS_SECRET, redirect_output=False )

GEUtil.Msg( "Python debugger successfully connected!\n" )
17 changes: 17 additions & 0 deletions lib/ptvsd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ############################################################################
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you cannot locate the Apache License, Version 2.0, please send an email to
# vspython@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
# by the terms of the Apache License, Version 2.0.
#
# You must not remove this notice, or any other, from this software.
#
# ###########################################################################

__all__ = ['enable_attach', 'wait_for_attach', 'break_into_debugger', 'settrace']

from ptvsd.attach_server import enable_attach, wait_for_attach, break_into_debugger
Loading

0 comments on commit 8612812

Please sign in to comment.