Loading SimpleOCRCLI/Other/Build/Build.py +6 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,11 @@ from ScriptCollection.TFCPS.DotNet.TFCPS_CodeUnitSpecific_DotNet import TFCPS_Co def build(): platforms = ["win-x64", "linux-x64"] platforms = [ "win-x64", "linux-x64", "osx-x64", ] tf:TFCPS_CodeUnitSpecific_DotNet_Functions=TFCPS_CodeUnitSpecific_DotNet_CLI.parse(__file__) tf.build(platforms, False) #TODO generate winget-artifact Loading SimpleOCRCLI/SimpleOCRCLI.sln +10 −2 Original line number Diff line number Diff line Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32014.148 # Visual Studio Version 18 VisualStudioVersion = 18.4.11612.150 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleOCRCLITests", "SimpleOCRCLITests\SimpleOCRCLITests.csproj", "{C6110F13-7E67-4CD1-9333-D984EE5C4BFC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleOCRCLI", "SimpleOCRCLI\SimpleOCRCLI.csproj", "{C4A091F6-0315-8687-B59B-F9E210F10502}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleOCRLibrary", "..\SimpleOCRLibrary\SimpleOCRLibrary\SimpleOCRLibrary.csproj", "{2AB3E305-EF7C-6DBF-0AA4-328145001C56}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Development|Any CPU = Development|Any CPU Loading @@ -26,6 +28,12 @@ Global {C4A091F6-0315-8687-B59B-F9E210F10502}.Productive|Any CPU.Build.0 = Productive|Any CPU {C4A091F6-0315-8687-B59B-F9E210F10502}.QualityCheck|Any CPU.ActiveCfg = QualityCheck|Any CPU {C4A091F6-0315-8687-B59B-F9E210F10502}.QualityCheck|Any CPU.Build.0 = QualityCheck|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Development|Any CPU.ActiveCfg = Development|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Development|Any CPU.Build.0 = Development|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Productive|Any CPU.ActiveCfg = Productive|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Productive|Any CPU.Build.0 = Productive|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.QualityCheck|Any CPU.ActiveCfg = QualityCheck|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.QualityCheck|Any CPU.Build.0 = QualityCheck|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Loading SimpleOCRCLI/SimpleOCRCLI/Helper/ProgramStarter.cs +7 −9 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ using GRYLibrary.Core.Logging.GRYLogger; using Error = CommandLine.Error; using SimpleOCR.CLI.Core.Verbs; using System; using SimpleOCR.CLI.Core.Runner; namespace SimpleOCR.CLI.Core.Helper { Loading Loading @@ -44,20 +45,17 @@ namespace SimpleOCR.CLI.Core.Helper } else { ParserResult<OCRAnalysisVerb> parserResult = Parser.Default.ParseArguments<OCRAnalysisVerb>(arguments); ParserResult<object> parserResult = Parser.Default.ParseArguments<DownloadOCRData, OCRAnalysis>(arguments); return parserResult.MapResult( parsedArgument => { this.VerbVisitor = new VerbVisitor(); return parsedArgument.Accept(this.VerbVisitor); }, (errors) => this.HandleErrors(errors, parserResult) (DownloadOCRData parsedArgument) => parsedArgument.Accept(new VerbVisitor()), (OCRAnalysis parsedArgument) => parsedArgument.Accept(new VerbVisitor()), errors => this.HandleErrors(errors, parserResult) ); } } catch(System.Exception exception) { Console.Error.WriteLine($"An error occurred: {exception.Message}"); _Log.Log(exception); return 2; } } Loading @@ -70,7 +68,7 @@ namespace SimpleOCR.CLI.Core.Helper } } private int HandleErrors(IEnumerable<Error> errors, ParserResult<OCRAnalysisVerb> parserResult) private int HandleErrors(IEnumerable<Error> errors, ParserResult<object> parserResult) { if(errors.IsHelp()) { Loading SimpleOCRCLI/SimpleOCRCLI/Helper/VerbVisitor.cs +2 −2 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ namespace SimpleOCR.CLI.Core.Helper { } public int Handle(OCRAnalysisVerb runWithOptionsFromCLI) public int Handle(OCRAnalysis runWithOptionsFromCLI) { this.RunBase = new RunOCRAnalysis(runWithOptionsFromCLI); return this.RunBase.Run(); } public int Handle(DownloadOCRDataVerb downloadOCRData) public int Handle(DownloadOCRData downloadOCRData) { this.RunBase = new RunDownloader(downloadOCRData); return this.RunBase.Run(); Loading SimpleOCRCLI/SimpleOCRCLI/Misc/Constants.cs 0 → 100644 +7 −0 Original line number Diff line number Diff line namespace SimpleOCR.CLI.Core.Misc { internal class Constants { public const string EnvVariableNameForDataFolder="SimpleOCRDataFolder"; } } Loading
SimpleOCRCLI/Other/Build/Build.py +6 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,11 @@ from ScriptCollection.TFCPS.DotNet.TFCPS_CodeUnitSpecific_DotNet import TFCPS_Co def build(): platforms = ["win-x64", "linux-x64"] platforms = [ "win-x64", "linux-x64", "osx-x64", ] tf:TFCPS_CodeUnitSpecific_DotNet_Functions=TFCPS_CodeUnitSpecific_DotNet_CLI.parse(__file__) tf.build(platforms, False) #TODO generate winget-artifact Loading
SimpleOCRCLI/SimpleOCRCLI.sln +10 −2 Original line number Diff line number Diff line Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32014.148 # Visual Studio Version 18 VisualStudioVersion = 18.4.11612.150 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleOCRCLITests", "SimpleOCRCLITests\SimpleOCRCLITests.csproj", "{C6110F13-7E67-4CD1-9333-D984EE5C4BFC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleOCRCLI", "SimpleOCRCLI\SimpleOCRCLI.csproj", "{C4A091F6-0315-8687-B59B-F9E210F10502}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleOCRLibrary", "..\SimpleOCRLibrary\SimpleOCRLibrary\SimpleOCRLibrary.csproj", "{2AB3E305-EF7C-6DBF-0AA4-328145001C56}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Development|Any CPU = Development|Any CPU Loading @@ -26,6 +28,12 @@ Global {C4A091F6-0315-8687-B59B-F9E210F10502}.Productive|Any CPU.Build.0 = Productive|Any CPU {C4A091F6-0315-8687-B59B-F9E210F10502}.QualityCheck|Any CPU.ActiveCfg = QualityCheck|Any CPU {C4A091F6-0315-8687-B59B-F9E210F10502}.QualityCheck|Any CPU.Build.0 = QualityCheck|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Development|Any CPU.ActiveCfg = Development|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Development|Any CPU.Build.0 = Development|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Productive|Any CPU.ActiveCfg = Productive|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.Productive|Any CPU.Build.0 = Productive|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.QualityCheck|Any CPU.ActiveCfg = QualityCheck|Any CPU {2AB3E305-EF7C-6DBF-0AA4-328145001C56}.QualityCheck|Any CPU.Build.0 = QualityCheck|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Loading
SimpleOCRCLI/SimpleOCRCLI/Helper/ProgramStarter.cs +7 −9 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ using GRYLibrary.Core.Logging.GRYLogger; using Error = CommandLine.Error; using SimpleOCR.CLI.Core.Verbs; using System; using SimpleOCR.CLI.Core.Runner; namespace SimpleOCR.CLI.Core.Helper { Loading Loading @@ -44,20 +45,17 @@ namespace SimpleOCR.CLI.Core.Helper } else { ParserResult<OCRAnalysisVerb> parserResult = Parser.Default.ParseArguments<OCRAnalysisVerb>(arguments); ParserResult<object> parserResult = Parser.Default.ParseArguments<DownloadOCRData, OCRAnalysis>(arguments); return parserResult.MapResult( parsedArgument => { this.VerbVisitor = new VerbVisitor(); return parsedArgument.Accept(this.VerbVisitor); }, (errors) => this.HandleErrors(errors, parserResult) (DownloadOCRData parsedArgument) => parsedArgument.Accept(new VerbVisitor()), (OCRAnalysis parsedArgument) => parsedArgument.Accept(new VerbVisitor()), errors => this.HandleErrors(errors, parserResult) ); } } catch(System.Exception exception) { Console.Error.WriteLine($"An error occurred: {exception.Message}"); _Log.Log(exception); return 2; } } Loading @@ -70,7 +68,7 @@ namespace SimpleOCR.CLI.Core.Helper } } private int HandleErrors(IEnumerable<Error> errors, ParserResult<OCRAnalysisVerb> parserResult) private int HandleErrors(IEnumerable<Error> errors, ParserResult<object> parserResult) { if(errors.IsHelp()) { Loading
SimpleOCRCLI/SimpleOCRCLI/Helper/VerbVisitor.cs +2 −2 Original line number Diff line number Diff line Loading @@ -10,13 +10,13 @@ namespace SimpleOCR.CLI.Core.Helper { } public int Handle(OCRAnalysisVerb runWithOptionsFromCLI) public int Handle(OCRAnalysis runWithOptionsFromCLI) { this.RunBase = new RunOCRAnalysis(runWithOptionsFromCLI); return this.RunBase.Run(); } public int Handle(DownloadOCRDataVerb downloadOCRData) public int Handle(DownloadOCRData downloadOCRData) { this.RunBase = new RunDownloader(downloadOCRData); return this.RunBase.Run(); Loading
SimpleOCRCLI/SimpleOCRCLI/Misc/Constants.cs 0 → 100644 +7 −0 Original line number Diff line number Diff line namespace SimpleOCR.CLI.Core.Misc { internal class Constants { public const string EnvVariableNameForDataFolder="SimpleOCRDataFolder"; } }