Skip to content

Commit

Permalink
fix(engine): disabled validation and readded azure settings for tests
Browse files Browse the repository at this point in the history
In tests, there seems to be a bug with epub validation on windows on the pipeline side (with the set-doctype step raising an error while reading files)

Readded the speech configuration fields in addin settings for tts test.
  • Loading branch information
NPavie committed Dec 19, 2024
1 parent c2690ad commit f03bf5c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 122 deletions.
146 changes: 28 additions & 118 deletions Common/DaisyAddinLib/ConverterSettingsForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
<value>Bottom, Right</value>
</data>
<data name="btn_ok.Location" type="System.Drawing.Point, System.Drawing">
<value>531, 566</value>
<value>531, 646</value>
</data>
<data name="btn_ok.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
Expand Down Expand Up @@ -466,7 +466,7 @@
<value>Bottom, Right</value>
</data>
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>423, 566</value>
<value>423, 646</value>
</data>
<data name="btnCancel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
Expand Down Expand Up @@ -1030,121 +1030,7 @@
<value>11</value>
</data>
<data name="TextToSpeechBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="&gt;&gt;AzureKeyValue.Name" xml:space="preserve">
<value>AzureKeyValue</value>
</data>
<data name="&gt;&gt;AzureKeyValue.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;AzureKeyValue.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;AzureKeyValue.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;AzureKeyLabel.Name" xml:space="preserve">
<value>AzureKeyLabel</value>
</data>
<data name="&gt;&gt;AzureKeyLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;AzureKeyLabel.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;AzureKeyLabel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;AzureRegionValue.Name" xml:space="preserve">
<value>AzureRegionValue</value>
</data>
<data name="&gt;&gt;AzureRegionValue.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;AzureRegionValue.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;AzureRegionValue.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;AzureRegionLabel.Name" xml:space="preserve">
<value>AzureRegionLabel</value>
</data>
<data name="&gt;&gt;AzureRegionLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;AzureRegionLabel.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;AzureRegionLabel.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;TTSConfigFileBrowse.Name" xml:space="preserve">
<value>TTSConfigFileBrowse</value>
</data>
<data name="&gt;&gt;TTSConfigFileBrowse.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TTSConfigFileBrowse.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;TTSConfigFileBrowse.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;TTSConfigFilePath.Name" xml:space="preserve">
<value>TTSConfigFilePath</value>
</data>
<data name="&gt;&gt;TTSConfigFilePath.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TTSConfigFilePath.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;TTSConfigFilePath.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;TTSConfigFileLabel.Name" xml:space="preserve">
<value>TTSConfigFileLabel</value>
</data>
<data name="&gt;&gt;TTSConfigFileLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TTSConfigFileLabel.Parent" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;TTSConfigFileLabel.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="TextToSpeechBox.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="TextToSpeechBox.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 508</value>
</data>
<data name="TextToSpeechBox.Size" type="System.Drawing.Size, System.Drawing">
<value>624, 10</value>
</data>
<data name="TextToSpeechBox.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="TextToSpeechBox.Text" xml:space="preserve">
<value>Speech synthesis</value>
</data>
<data name="TextToSpeechBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.Name" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.ZOrder" xml:space="preserve">
<value>5</value>
<value>Top, Bottom, Left, Right</value>
</data>
<data name="AzureKeyValue.AccessibleDescription" xml:space="preserve">
<value>One of the two keys provided in your Azure Speech Service resource panel</value>
Expand Down Expand Up @@ -1596,6 +1482,30 @@
<data name="&gt;&gt;TTSConfigFileLabel.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="TextToSpeechBox.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 508</value>
</data>
<data name="TextToSpeechBox.Size" type="System.Drawing.Size, System.Drawing">
<value>624, 131</value>
</data>
<data name="TextToSpeechBox.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="TextToSpeechBox.Text" xml:space="preserve">
<value>Speech synthesis</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.Name" xml:space="preserve">
<value>TextToSpeechBox</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;TextToSpeechBox.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<metadata name="TTSConfigFileSelect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Expand Down Expand Up @@ -1642,7 +1552,7 @@
<value>8, 16</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>643, 607</value>
<value>643, 687</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
Expand Down
16 changes: 14 additions & 2 deletions Common/DaisyConverterLib/Pipeline/ChainedScripts/WordToDaisy202.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public WordToDaisy202(IConversionEventsHandler e) : base(e)
{ "Report validation issues", "report" },
{ "Abort on validation issues", "abort" },
}, "Abort on validation issues"),
"report",
"off",
false,
"Whether to abort on validation issues."
)
Expand Down Expand Up @@ -250,6 +250,18 @@ public override void ExecuteScript(string inputPath, bool isQuite)
scripts[i].Parameters[k] = this._parameters[k];
}
}
if (scripts[i].Parameters.ContainsKey("validation") &&
scripts[i].Parameters.ContainsKey("validation-report") &&
scripts[i].Parameters["validation"].ParameterValue.ToString() == "report"
) {
scripts[i].Parameters["validation-report"].ParameterValue = Directory.CreateDirectory(Path.Combine(finalOutput.FullName, "report")).FullName;
}
if (scripts[i].Parameters.ContainsKey("include-tts-log") &&
scripts[i].Parameters.ContainsKey("tts-log") &&
(bool)scripts[i].Parameters["include-tts-log"].ParameterValue == true
) {
scripts[i].Parameters["tts-log"].ParameterValue = Directory.CreateDirectory(Path.Combine(finalOutput.FullName, "tts-log")).FullName;
}

#if DEBUG
this.EventsHandler.onProgressMessageReceived(
Expand All @@ -259,7 +271,7 @@ public override void ExecuteScript(string inputPath, bool isQuite)
)
);
#else
this.EventsHandler.onProgressMessageReceived(this, new DaisyEventArgs($"Launching script {scripts[i].Name} ... "));
this.EventsHandler.onProgressMessageReceived(this, new DaisyEventArgs($"Applying script {scripts[i].Name} ... "));
#endif
// rebind input and output
scripts[i].Parameters["input"].ParameterValue = input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public WordToEpub3(IConversionEventsHandler e): base(e) {
{ "Report validation issues", "report" },
{ "Abort on validation issues", "abort" },
}, "Abort on validation issues"),
"report",
"off",
false,
"Whether to abort on validation issues."
)
Expand Down
2 changes: 1 addition & 1 deletion Common/DaisyConverterLib/Pipeline/Pipeline2/Pipeline2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private Pipeline2()
{ "-Dorg.daisy.pipeline.logdir", LogsFolder.Replace("\\", "/") },
{ "-Dorg.daisy.pipeline.mode", "cli" }
};
if (GlobaleSettings.AzureSpeechKey != "")
if (GlobaleSettings.AzureSpeechKey != "" && GlobaleSettings.AzureSpeechRegion != "")
{
SystemProps["-Dorg.daisy.pipeline.tts.azure.key"] = GlobaleSettings.AzureSpeechKey;
SystemProps["-Dorg.daisy.pipeline.tts.azure.region"] =
Expand Down

0 comments on commit f03bf5c

Please sign in to comment.