Permalink
Browse files

-dodanie projektu

-testowy plik z "web server" w Twisted
  • Loading branch information...
devel devel
devel authored and devel committed Mar 17, 2014
0 parents commit fd20fd6259f8f6d1e9c5b498927ec8d581eec01f
Showing with 68 additions and 0 deletions.
  1. +18 −0 poc/golemPy/golem.py
  2. +28 −0 poc/golemPy/golem.pyproj
  3. +22 −0 poc/golemPy/golem.sln
@@ -0,0 +1,18 @@
from twisted.web import server, resource
from twisted.internet import reactor

class HelloResource(resource.Resource):
isLeaf = True
numberRequests = 0

def render_GET(self, request):
self.numberRequests += 1
request.setHeader("content-type", "text/plain")
return "I am request #" + str(self.numberRequests) + "\n"

hr1 = HelloResource()
hr2 = HelloResource()
reactor.callInThread(reactor.listenTCP, 8080, server.Site(hr1))
reactor.callInThread(reactor.listenTCP, 8081, server.Site(hr2))
#reactor.listenTCP(8080, server.Site(hr1))
reactor.run()
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>789d2354-e38a-4f32-a9ac-10b35fe45f26</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>golem.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>golem</Name>
<RootNamespace>golem</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="golem.py" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
</Project>
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "golem", "golem.pyproj", "{789D2354-E38A-4F32-A9AC-10B35FE45F26}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{789D2354-E38A-4F32-A9AC-10B35FE45F26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{789D2354-E38A-4F32-A9AC-10B35FE45F26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{789D2354-E38A-4F32-A9AC-10B35FE45F26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{789D2354-E38A-4F32-A9AC-10B35FE45F26}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

0 comments on commit fd20fd6

Please sign in to comment.