Merge pull request #274 from HojouFotytu/develop

Remove PT Path Check
This commit is contained in:
HojouFotytu 2021-02-23 12:58:51 +09:00 committed by GitHub
commit c02571832c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 37 deletions

View File

@ -35,7 +35,6 @@ namespace Core.Main.DataObjects.PTMagicData
public bool IsEnabled { get; set; } = true; public bool IsEnabled { get; set; } = true;
public bool TestMode { get; set; } = true; public bool TestMode { get; set; } = true;
public bool EnableBetaFeatures { get; set; } = false; public bool EnableBetaFeatures { get; set; } = false;
public string ProfitTrailerPath { get; set; }
public string ProfitTrailerLicense { get; set; } = ""; public string ProfitTrailerLicense { get; set; } = "";
public string ProfitTrailerServerAPIToken { get; set; } public string ProfitTrailerServerAPIToken { get; set; }
public string ProfitTrailerMonitorURL { get; set; } = "http://localhost:8081/"; public string ProfitTrailerMonitorURL { get; set; } = "http://localhost:8081/";

View File

@ -703,20 +703,11 @@ namespace Core.Main
{ {
try try
{ {
if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode) this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!"); if (this.PTMagicConfiguration.GeneralSettings.Application.TestMode)
// Check for PT Directory
DirectoryInfo ptRoot = new DirectoryInfo(this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath);
if (ptRoot.Exists)
{ {
this.Log.DoLogInfo("Profit Trailer directory found"); this.Log.DoLogInfo("TESTMODE ENABLED - No files will be changed!");
}
result = RunProfitTrailerSettingsAPIChecks(); result = RunProfitTrailerSettingsAPIChecks();
}
else
{
this.Log.DoLogError("Profit Trailer directory not found (" + this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + ")");
result = false;
}
// Check for CoinMarketCap API Key // Check for CoinMarketCap API Key
if (!String.IsNullOrEmpty(this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey)) if (!String.IsNullOrEmpty(this.PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey))
@ -1142,14 +1133,7 @@ namespace Core.Main
} }
} }
private void GetProfitTrailerPropertiesPaths(out string pairsPropertiesPath, out string dcaPropertiesPath, out string indicatorsPropertiesPath)
{
// Get current PT properties // Get current PT properties
pairsPropertiesPath = this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + Constants.PTPathTrading + Path.DirectorySeparatorChar + this.PairsFileName;
dcaPropertiesPath = this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + Constants.PTPathTrading + Path.DirectorySeparatorChar + this.DCAFileName;
indicatorsPropertiesPath = this.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath + Constants.PTPathTrading + Path.DirectorySeparatorChar + this.IndicatorsFileName;
}
private void LoadCurrentProfitTrailerProperties() private void LoadCurrentProfitTrailerProperties()
{ {
// Load current PT properties from API (Valid for PT 2.x and above) // Load current PT properties from API (Valid for PT 2.x and above)
@ -2143,9 +2127,6 @@ namespace Core.Main
private void SaveProfitTrailerProperties() private void SaveProfitTrailerProperties()
{ {
// Get current PT properties // Get current PT properties
string pairsPropertiesPath, dcaPropertiesPath, indicatorsPropertiesPath;
GetProfitTrailerPropertiesPaths(out pairsPropertiesPath, out dcaPropertiesPath, out indicatorsPropertiesPath);
if (this.GlobalSettingWritten || this.SingleMarketSettingChanged) if (this.GlobalSettingWritten || this.SingleMarketSettingChanged)
{ {
// Save current PT properties to API (Valid for PT 2.x and above) // Save current PT properties to API (Valid for PT 2.x and above)

View File

@ -47,11 +47,6 @@ namespace Core.Main
AnalyzerSettingsWrapper asw = JsonConvert.DeserializeObject<AnalyzerSettingsWrapper>(File.ReadAllText(basePath + "settings.analyzer.json")); AnalyzerSettingsWrapper asw = JsonConvert.DeserializeObject<AnalyzerSettingsWrapper>(File.ReadAllText(basePath + "settings.analyzer.json"));
_analyzerSettings = asw.AnalyzerSettings; _analyzerSettings = asw.AnalyzerSettings;
if (!_generalSettings.Application.ProfitTrailerPath.EndsWith(Path.DirectorySeparatorChar))
{
_generalSettings.Application.ProfitTrailerPath += Path.DirectorySeparatorChar;
}
if (!_generalSettings.Application.ProfitTrailerMonitorURL.EndsWith("/")) if (!_generalSettings.Application.ProfitTrailerMonitorURL.EndsWith("/"))
{ {
_generalSettings.Application.ProfitTrailerMonitorURL += "/"; _generalSettings.Application.ProfitTrailerMonitorURL += "/";

View File

@ -68,12 +68,6 @@
</div> </div>
</div> </div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Profit Trailer Path <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="Path to your Profit Trailer main directory."></i></label>
<div class="col-md-8">
@Model.PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerPath
</div>
</div>
<div class="form-group row"> <div class="form-group row">
<label class="col-md-4 col-form-label">Profit Trailer License <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="Your Profit Trailer license key (needed to change your settings for PT 2.0 and above)"></i></label> <label class="col-md-4 col-form-label">Profit Trailer License <i class="fa fa-info-circle text-muted" data-toggle="tooltip" data-placement="top" title="Your Profit Trailer license key (needed to change your settings for PT 2.0 and above)"></i></label>

View File

@ -3,7 +3,6 @@
"Application": { "Application": {
"IsEnabled": true, // Enables the PTMagic bot (needs restart to take effect) "IsEnabled": true, // Enables the PTMagic bot (needs restart to take effect)
"TestMode": false, // If TestMode is active, no properties files will be changed "TestMode": false, // If TestMode is active, no properties files will be changed
"ProfitTrailerPath": "YOUR PROFIT TRAILER PATH", // Path to your Profit Trailer main directory (use double backslashes for windows like C:\\ProfitTrailer\\)
"ProfitTrailerLicense": "YOUR PROFIT TRAILER LICENSE KEY", // Your Profit Trailer license key (needed to change your settings for PT 2.0 and above) "ProfitTrailerLicense": "YOUR PROFIT TRAILER LICENSE KEY", // Your Profit Trailer license key (needed to change your settings for PT 2.0 and above)
"ProfitTrailerServerAPIToken": "", //Your Profit Trailer Server API Token "ProfitTrailerServerAPIToken": "", //Your Profit Trailer Server API Token
"ProfitTrailerMonitorURL": "http://localhost:8081/", // The URL to your profit trailer monitor (needed to change your settings for PT 2.0 and above) "ProfitTrailerMonitorURL": "http://localhost:8081/", // The URL to your profit trailer monitor (needed to change your settings for PT 2.0 and above)

View File

@ -3,7 +3,6 @@
"Application": { "Application": {
"IsEnabled": true, // Enables the PTMagic bot (needs restart to take effect) "IsEnabled": true, // Enables the PTMagic bot (needs restart to take effect)
"TestMode": false, // If TestMode is active, no properties files will be changed "TestMode": false, // If TestMode is active, no properties files will be changed
"ProfitTrailerPath": "YOUR PROFIT TRAILER PATH", // Path to your Profit Trailer main directory (use double backslashes for windows like C:\\ProfitTrailer\\)
"ProfitTrailerLicense": "YOUR PROFIT TRAILER LICENSE KEY", // Your Profit Trailer license key (needed to change your settings for PT 2.0 and above) "ProfitTrailerLicense": "YOUR PROFIT TRAILER LICENSE KEY", // Your Profit Trailer license key (needed to change your settings for PT 2.0 and above)
"ProfitTrailerServerAPIToken": "", //Your Profit Trailer Server API Token "ProfitTrailerServerAPIToken": "", //Your Profit Trailer Server API Token
"ProfitTrailerMonitorURL": "http://localhost:8081/", // The URL to your profit trailer monitor (needed to change your settings for PT 2.0 and above) "ProfitTrailerMonitorURL": "http://localhost:8081/", // The URL to your profit trailer monitor (needed to change your settings for PT 2.0 and above)