Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Laharah committed Aug 2, 2017
2 parents 02a437b + cc61a50 commit 750ff6c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
@@ -1,7 +1,7 @@
# FilebotTool: FileBot Integration for Deluge
*requires [Filebot](http://www.filebot.net/)*

**Version 1.1.8**
**Version 1.1.10**

##### [Download Latest Release](https://github.com/Laharah/deluge-FilebotTool/releases/latest)

Expand Down Expand Up @@ -57,7 +57,7 @@ if you want the very latest release, you can build the plugin from source.

You will need:
- git
- a version of python that matches your deluge version (2.6 by default)
- a version of python that matches your deluge version (2.7 by default)

##### Instructions:
- in a command window, type
Expand All @@ -69,10 +69,10 @@ You will need:

- then to build the plugin, on linux/osx type:
```
python2.6 setup.py bdist_egg # replace with 2.7 if deluge uses python 2.7
python2.7 setup.py bdist_egg # replace with 2.6 if your deluge uses python 2.6
```
or on windows:
```
py -2.6 setup.py bdist_egg
py -2.7 setup.py bdist_egg
```
- The new .egg file located in the `dist/` folder is now ready to be added to deluge.
4 changes: 2 additions & 2 deletions filebottool/core.py
Expand Up @@ -94,8 +94,8 @@ def enable(self):
self.filebot_version = pyfilebot.get_version()
log.info("Filebot Found with version {0}".format(
self.filebot_version))
except pyfilebot.FilebotFatalError:
log.error("Filebot cannot be found!")
except pyfilebot.FilebotFatalError as e:
log.error('FilebotFatalError ' + str(e))
self.filebot_version = None

self.torrent_manager = component.get("TorrentManager")
Expand Down
11 changes: 6 additions & 5 deletions filebottool/pyfilebot.py
Expand Up @@ -20,7 +20,7 @@
if not FILEBOT_EXE:
locations = [
r'C:\Program Files\FileBot\filebot.exe', r'/usr/bin/filebot',
r'/usr/local/bin/filebot'
r'/usr/local/bin/filebot', r'/snap/bin/filebot'
]
for loc in locations:
if os.path.exists(loc):
Expand Down Expand Up @@ -141,7 +141,8 @@ def rename(targets,
language_code=language_code)

# TODO:better error handling
exit_code, data, filebot_error = _execute(filebot_arguments)
workaround = True if os.name == 'nt' else False
exit_code, data, filebot_error = _execute(filebot_arguments, workaround)

if exit_code != 0:
raise FilebotRuntimeError("FILEBOT OUTPUT DUMP:\n{0}".format(data))
Expand Down Expand Up @@ -546,7 +547,7 @@ def _build_script_arguments(script_name, script_arguments):
return process_arguments


def _execute(process_arguments, workaround=True):
def _execute(process_arguments, workaround=False):
"""underlying execution method to call filebot as subprocess
Handles the actual execution and output capture
Expand Down Expand Up @@ -583,8 +584,8 @@ def _execute(process_arguments, workaround=True):
stderr=killableprocess.subprocess.PIPE,
stdin=killableprocess.subprocess.PIPE,
startupinfo=startupinfo)
except OSError:
raise FilebotFatalError("Filebot could not be found!")
except OSError as e:
raise FilebotFatalError("Error running Filebot! {0}".format(str(e)))

stdout, error = process.communicate()
exit_code = process.returncode
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -42,7 +42,7 @@
__plugin_name__ = "FileBotTool"
__author__ = "laharah"
__author_email__ = "laharah+fbt@gmail.com"
__version__ = "1.1.8"
__version__ = "1.1.10"
__url__ = "https://github.com/Laharah/deluge-FileBotTool"
__license__ = "GPLv3"
__description__ = "Integrates FileBot functionality to Deluge"
Expand Down

0 comments on commit 750ff6c

Please sign in to comment.