From 59603deb6a9e3e0d5055af376507cfa0ea570527 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 12 Feb 2019 22:35:43 -0600 Subject: [PATCH] fixed first log --- onionr/logger.py | 13 +++++++------ onionr/onionr.py | 11 ----------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/onionr/logger.py b/onionr/logger.py index c9639b0d..896e2623 100755 --- a/onionr/logger.py +++ b/onionr/logger.py @@ -134,12 +134,13 @@ def raw(data, fd = sys.stdout, sensitive = False): if get_settings() & OUTPUT_TO_CONSOLE: ts = fd.write('%s\n' % data) if get_settings() & OUTPUT_TO_FILE and not sensitive: - if os.path.getsize(_outputfile) < MAX_LOG_SIZE: - try: - with open(_outputfile, "a+") as f: - f.write(colors.filter(data) + '\n') - except OSError: - pass + if os.path.getsize(_outputfile) >= MAX_LOG_SIZE: + return + try: + with open(_outputfile, "a+") as f: + f.write(colors.filter(data) + '\n') + except OSError: + pass def log(prefix, data, color = '', timestamp=True, fd = sys.stdout, prompt = True, sensitive = False): ''' diff --git a/onionr/onionr.py b/onionr/onionr.py index 54f83616..901f6ffe 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -207,9 +207,6 @@ class Onionr: 'connect': self.addAddress, 'pex': self.doPEX, - 'ui' : self.openUI, - 'gui' : self.openUI, - 'getpassword': self.printWebPassword, 'get-password': self.printWebPassword, 'getpwd': self.printWebPassword, @@ -298,8 +295,6 @@ class Onionr: with open('%s/%s.dat' % (exportDir, bHash), 'wb') as exportFile: exportFile.write(data) - - def showDetails(self): details = { 'Node Address' : self.get_hostname(), @@ -1062,12 +1057,6 @@ class Onionr: return data_exists - def openUI(self): - url = 'http://127.0.0.1:%s/ui/index.html?timingToken=%s' % (config.get('client.port', 59496), self.onionrUtils.getTimeBypassToken()) - - logger.info('Opening %s ...' % url) - webbrowser.open(url, new = 1, autoraise = True) - def header(self, message = logger.colors.fg.pink + logger.colors.bold + 'Onionr' + logger.colors.reset + logger.colors.fg.pink + ' has started.'): if os.path.exists('static-data/header.txt') and logger.get_level() <= logger.LEVEL_INFO: with open('static-data/header.txt', 'rb') as file: