summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar Gregy <gregy@gregy.cz> 2010-08-08 11:59:53 +0200
committerGravatar Gregy <gregy@gregy.cz> 2010-08-08 11:59:53 +0200
commitabc562faf737ad769ec03f5ac94ba467de828ffa (patch)
tree6f826bfe618eb1da28e3c722d360f828469d4dba /pyLoadCore.py
parentmerge (diff)
downloadpyload-abc562faf737ad769ec03f5ac94ba467de828ffa.tar.xz
Handling special cases in log (empty, non existing..)
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index d40173aed..2bc2a946e 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -544,15 +544,15 @@ class ServerMethods():
self.add_package(th.name, [th.name], 1)
- def get_log(self, offset=0):
+ def get_log(self):
filename = join(self.core.config['log']['log_folder'], 'log.txt')
- fh = open(filename, "r")
- lines = fh.readlines()
- fh.close()
- if offset >= len(lines):
- return None
-
- return lines
+ try:
+ fh = open(filename, "r")
+ lines = fh.readlines()
+ fh.close()
+ return lines
+ except:
+ return ('No log available',)
def stop_downloads(self):
pyfiles = self.core.files.cache.values()