Skip to content

Commit 20b97ed

Browse files
committed
PR Cleanups
1 parent 5f128d4 commit 20b97ed

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private void generateConfig(GenerationContext context, PythonWriter writer) {
324324
writer.addStdlibImport("dataclasses", "dataclass");
325325
writer.write("""
326326
@dataclass(init=False)
327-
class $T:
327+
class $L:
328328
\"""Configuration for $L.\"""
329329
330330
${C|}
@@ -340,7 +340,7 @@ def __init__(
340340
\"""
341341
${C|}
342342
""",
343-
configSymbol,
343+
configSymbol.getName(),
344344
context.settings().service().getName(),
345345
writer.consumer(w -> writePropertyDeclarations(w, finalProperties)),
346346
writer.consumer(w -> writeInitParams(w, finalProperties)),

codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/UserAgentIntegration.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@ public class UserAgentIntegration implements PythonIntegration {
1919
@Override
2020
public List<RuntimeClientPlugin> getClientPlugins(GenerationContext context) {
2121
if (context.applicationProtocol().isHttpProtocol()) {
22-
return List.of(
23-
RuntimeClientPlugin.builder()
24-
.pythonPlugin(
25-
SymbolReference.builder()
26-
.symbol(Symbol.builder()
27-
.namespace(
28-
SmithyPythonDependency.SMITHY_HTTP.packageName()
29-
+ ".plugins",
30-
".")
31-
.name("user_agent_plugin")
32-
.addDependency(SmithyPythonDependency.SMITHY_HTTP)
33-
.build())
34-
.build())
35-
.build());
22+
var userAgentPlugin = SymbolReference
23+
.builder()
24+
.symbol(
25+
Symbol.builder()
26+
.namespace(
27+
SmithyPythonDependency.SMITHY_HTTP.packageName() + ".plugins",
28+
".")
29+
.name("user_agent_plugin")
30+
.addDependency(SmithyPythonDependency.SMITHY_HTTP)
31+
.build())
32+
.build();
33+
return List.of(RuntimeClientPlugin.builder().pythonPlugin(userAgentPlugin).build());
3634
} else {
3735
return List.of();
3836
}

0 commit comments

Comments
 (0)