diff options
author | Gregy <gregy@gregy.cz> | 2010-08-08 11:59:53 +0200 |
---|---|---|
committer | Gregy <gregy@gregy.cz> | 2010-08-08 11:59:53 +0200 |
commit | abc562faf737ad769ec03f5ac94ba467de828ffa (patch) | |
tree | 6f826bfe618eb1da28e3c722d360f828469d4dba /pyLoadCore.py | |
parent | merge (diff) | |
download | pyload-abc562faf737ad769ec03f5ac94ba467de828ffa.tar.xz |
Handling special cases in log (empty, non existing..)
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 16 |
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() |