Revize 9547fd4a
Přidáno uživatelem Eliška Mourycová před téměř 4 roky(ů)
Server/ServerApp/Program.cs | ||
---|---|---|
99 | 99 |
DataDownloader dd = new DataDownloader(config.DataRootDir, config.DataWebsite, config.DownloadedFilesNaming); |
100 | 100 |
dd.OverwriteExisting = false; |
101 | 101 |
List<string> savedFiles = new List<string>(); |
102 |
savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, new DataDownload.Date(1, 2019), new DataDownload.Date(12, 2020))); |
|
103 |
savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2020))); |
|
104 |
savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2020))); |
|
102 |
|
|
103 |
// -> 12-2019 to exclude corona? But we lose a lot of data |
|
104 |
savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2019))); |
|
105 |
savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2019))); |
|
106 |
savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, new DataDownload.Date(1, 2017), new DataDownload.Date(12, 2019))); |
|
105 | 107 |
|
106 | 108 |
|
107 | 109 |
|
... | ... | |
205 | 207 |
Config extractedConfigInfo = new Config(); |
206 | 208 |
|
207 | 209 |
Console.WriteLine(Directory.GetCurrentDirectory()); |
210 |
Console.WriteLine("Parsing configuration file..."); |
|
208 | 211 |
|
209 | 212 |
if (args.Length != 1) |
210 | 213 |
Console.WriteLine("Wrong usage of parameters, pass the path to a config file."); // todo better explanation? |
... | ... | |
223 | 226 |
for (var i = 0; i < lines.Length; i += 1) |
224 | 227 |
{ |
225 | 228 |
string line = lines[i]; |
226 |
Console.WriteLine(line); |
|
229 |
//Console.WriteLine(line);
|
|
227 | 230 |
if (line.Length == 0 || line == null || line.StartsWith("#")) |
228 | 231 |
continue; |
229 | 232 |
|
... | ... | |
236 | 239 |
extractedConfigInfo.DownloadedFilesNaming = lines[++i].Trim(); |
237 | 240 |
break; |
238 | 241 |
case "!data_root_dir!": |
242 |
//string rootDir = lines[++i]; |
|
243 |
//rootDir = rootDir.Replace('\\', Path.DirectorySeparatorChar); |
|
239 | 244 |
string dirWithConfig = Path.GetDirectoryName(fullPathConfig); |
240 | 245 |
string rootPath = dirWithConfig + Path.DirectorySeparatorChar + lines[++i].Trim(); |
246 |
rootPath = Path.GetFullPath(rootPath); |
|
241 | 247 |
extractedConfigInfo.DataRootDir = rootPath; |
242 |
|
|
243 | 248 |
break; |
244 | 249 |
case "!port!": |
245 | 250 |
extractedConfigInfo.Port = lines[++i].Trim(); |
Také k dispozici: Unified diff
Refs #9008, #8919. Data directory path should now be ok on linux + added interface for DataDownloader + changed time span of default downloaded data.