diff --git a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs index 91a632f806330..1b83e942a0bc6 100644 --- a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs +++ b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs @@ -237,9 +237,9 @@ public override async Task Generate(ServiceClient serviceClient) { var serviceClientTemplateModel = new AzureServiceClientTemplateModel(serviceClient); - if (!string.IsNullOrWhiteSpace(Version)) + if (!string.IsNullOrWhiteSpace(this.PackageVersion)) { - serviceClientTemplateModel.Version = Version; + serviceClientTemplateModel.Version = this.PackageVersion; } // Service client diff --git a/AutoRest/Generators/Python/Python/PythonCodeGenerator.cs b/AutoRest/Generators/Python/Python/PythonCodeGenerator.cs index 0a050047a15da..0a50960f9b5b9 100644 --- a/AutoRest/Generators/Python/Python/PythonCodeGenerator.cs +++ b/AutoRest/Generators/Python/Python/PythonCodeGenerator.cs @@ -19,9 +19,12 @@ public class PythonCodeGenerator : CodeGenerator { private const string ClientRuntimePackage = "msrest version 0.4.0"; + private string packageVersion; + public PythonCodeGenerator(Settings settings) : base(settings) { Namer = new PythonCodeNamer(); + this.packageVersion = Settings.PackageVersion; } public PythonCodeNamer Namer { get; set; } @@ -37,8 +40,10 @@ public override string Description get { return "Generic Python code generator."; } } - [SettingsInfo("The SDK version for generated setup.py.")] - public string Version { get; set; } + protected String PackageVersion + { + get { return this.packageVersion; } + } public override string UsageInstructions { @@ -94,9 +99,9 @@ public override async Task Generate(ServiceClient serviceClient) { var serviceClientTemplateModel = new ServiceClientTemplateModel(serviceClient); - if (!string.IsNullOrWhiteSpace(Version)) + if (!string.IsNullOrWhiteSpace(this.PackageVersion)) { - serviceClientTemplateModel.Version = Version; + serviceClientTemplateModel.Version = this.PackageVersion; } // Service client