Skip to content

Commit 6a1450e

Browse files
committed
Review fixes
1 parent 4213dc6 commit 6a1450e

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

python/Ice/context/client/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212

1313

1414
async def main():
15-
# Set the Ice.ImplicitContext property to "Shared" before calling Ice.initialize.
16-
# This is only necessary for the implicit context API (see below).
1715
initData = Ice.InitializationData()
1816
initData.properties = Ice.createProperties(sys.argv)
17+
18+
# Set the Ice.ImplicitContext property to "Shared" before calling Ice.initialize.
19+
# This is only necessary for the implicit context API (see below).
1920
initData.properties.setProperty("Ice.ImplicitContext", "Shared")
2021

21-
# Configure the Ice runtime to use asyncio.
22+
# Configure the communicator to use asyncio.
2223
initData.eventLoopAdapter = Ice.asyncio.EventLoopAdapter(asyncio.get_running_loop())
2324

2425
# Create an Ice communicator. We'll use this communicator to create proxies and manage outgoing connections.

python/Ice/greeter/server/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def main():
1111
# Create an Ice communicator. We'll use this communicator to create an object adapter.
1212
with Ice.initialize(sys.argv) as communicator:
1313
# Create an object adapter that listens for incoming requests and dispatches them to servants.
14-
adapter = communicator.createObjectAdapterWithEndpoints("GreeterAdapter", "tcp -p 4061")
14+
communicator.getProperties().setProperty("GreeterAdapter.AdapterId", "IceDiscovery/Locator:tcp -h localhost -p 4061")
15+
adapter = communicator.createObjectAdapterWithEndpoints("GreeterAdapter", None)
1516

1617
# Register the Chatbot servant with the adapter.
1718
adapter.add(chatbot.Chatbot(), Ice.Identity(name="greeter"))

python/Ice/optional/server1/console_printer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ class ConsolePrinter(WeatherStation):
1010
"""
1111

1212
# Implements the method report from the WeatherStation class generated by the Slice compiler.
13-
# This variant is the synchronous implementation.
1413
def report(self, sensorId: str, reading: AtmosphericConditions | None, current: Ice.Current) -> None:
1514
print(f"{sensorId} reported {reading} to station v1")

python/Ice/optional/server2/console_printer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ class ConsolePrinter(WeatherStation):
1010
"""
1111

1212
# Implements the method report from the WeatherStation class generated by the Slice compiler.
13-
# This variant is the synchronous implementation.
1413
def report(self, sensorId: str, reading: AtmosphericConditions | None, current: Ice.Current) -> None:
1514
print(f"{sensorId} reported {reading} to station v2")

python/IceDiscovery/greeter/client/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212

1313

1414
async def main():
15-
# Configure the communicator to load the IceDiscovery plug-in during initialization. This plug-in installs a default
16-
# locator on the communicator.
1715
initData = Ice.InitializationData()
1816
initData.properties = Ice.createProperties(sys.argv)
17+
18+
# Configure the communicator to load the IceDiscovery plug-in during initialization. This plug-in installs a default
19+
# locator on the communicator.
1920
initData.properties.setProperty("Ice.Plugin.IceDiscovery", "1")
2021

21-
# Configure the Ice runtime to use asyncio.
22+
# Configure the communicator to use asyncio.
2223
initData.eventLoopAdapter = Ice.asyncio.EventLoopAdapter(asyncio.get_running_loop())
2324

2425
# Create an Ice communicator. We'll use this communicator to create proxies, and manage outgoing connections.

python/IceDiscovery/greeter/server/chatbot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class Chatbot(VisitorCenter.Greeter):
1212
"""
1313

1414
# Implements the method greet from the Greeter class generated by the Slice compiler.
15-
# This variant is the synchronous implementation.
1615
def greet(self, name: str, current: Ice.Current) -> str:
1716
print(f"Dispatching greet request {{ name = '{name}' }}")
1817
return f"Hello, {name}!"

python/IceDiscovery/replication/client/main.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212

1313

1414
async def main():
15-
# Configure the communicator to load the IceDiscovery plug-in during initialization. This plug-in installs a default
16-
# locator on the communicator.
1715
initData = Ice.InitializationData()
1816
initData.properties = Ice.createProperties(sys.argv)
17+
# Configure the communicator to load the IceDiscovery plug-in during initialization. This plug-in installs a default
18+
# locator on the communicator.
1919
initData.properties.setProperty("Ice.Plugin.IceDiscovery", "1")
20-
21-
# Configure the Ice runtime to use asyncio.
20+
# Configure the communicator to use asyncio.
2221
initData.eventLoopAdapter = Ice.asyncio.EventLoopAdapter(asyncio.get_running_loop())
2322

2423
# Create an Ice communicator. We'll use this communicator to create proxies, and manage outgoing connections.

python/IceDiscovery/replication/server/chatbot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def __init__(self, greeterName: str):
2323
self._greeterName = greeterName
2424

2525
# Implements the method greet from the Greeter class generated by the Slice compiler.
26-
# This variant is the synchronous implementation.
2726
def greet(self, name: str, current: Ice.Current) -> str:
2827
print(f"Dispatching greet request {{ name = '{name}' }}")
2928
return f"Hello, {name}! I am {self._greeterName}. How can I help you today?"

0 commit comments

Comments
 (0)