Browse Source

Merge pull request #6087 from maxkoryukov/fix/rtorrent-upgrade

Integration with rTorrent 0.9.6
pull/6133/head
Ruud Burger 9 years ago
parent
commit
7fb5ded2f8
  1. 14
      .travis.yml
  2. 12
      CouchPotato.py
  3. 22
      libs/rtorrent/__init__.py
  4. 5
      py-dev-requirements.txt
  5. 12
      requirements-dev.txt

14
.travis.yml

@ -1,5 +1,8 @@
language: python
# with enabled SUDO the build goes slower
sudo: false
python:
# - "2.6"
- "2.7"
@ -15,18 +18,13 @@ cache:
directories:
- node_modules
- libs
- lib
# command to install dependencies
install:
- npm install
- pip install --upgrade pip
- pip install coverage
- pip install coveralls
# disabled, since we don't require colors for tests on travis
- pip install --upgrade nose
# - pip install rednose
- nosetests --plugins
- npm install
- pip install -r requirements-dev.txt -t ./libs
# command to run tests
script:

12
CouchPotato.py

@ -52,7 +52,7 @@ class Loader(object):
os.makedirs(self.data_dir)
# Create logging dir
self.log_dir = os.path.join(self.data_dir, 'logs');
self.log_dir = os.path.join(self.data_dir, 'logs')
if not os.path.isdir(self.log_dir):
os.makedirs(self.log_dir)
@ -79,7 +79,7 @@ class Loader(object):
def onExit(self, signal, frame):
from couchpotato.core.event import fireEvent
fireEvent('app.shutdown', single = True)
fireEvent('app.shutdown', single=True)
def run(self):
@ -96,8 +96,10 @@ class Loader(object):
# remove old pidfile first
try:
if self.runAsDaemon():
try: self.daemon.stop()
except: pass
try:
self.daemon.stop()
except:
pass
except:
self.log.critical(traceback.format_exc())
@ -122,7 +124,7 @@ class Loader(object):
self.log.critical(traceback.format_exc())
def runAsDaemon(self):
return self.options.daemon and self.options.pid_file
return self.options.daemon and self.options.pid_file
if __name__ == '__main__':

22
libs/rtorrent/__init__.py

@ -110,22 +110,22 @@ class RTorrent:
if file_type == "url":
# url strings can be input directly
if start and verbose:
func_name = "load_start_verbose"
func_name = "load.start_verbose"
elif start:
func_name = "load_start"
func_name = "load.start"
elif verbose:
func_name = "load_verbose"
func_name = "load.verbose"
else:
func_name = "load"
elif file_type in ["file", "raw"]:
if start and verbose:
func_name = "load_raw_start_verbose"
func_name = "load.raw_start_verbose"
elif start:
func_name = "load_raw_start"
func_name = "load.raw_start"
elif verbose:
func_name = "load_raw_verbose"
func_name = "load.raw_verbose"
else:
func_name = "load_raw"
func_name = "load.raw"
return(func_name)
@ -171,7 +171,9 @@ class RTorrent:
func_name = self._get_load_function("raw", start, verbose)
# load torrent
getattr(p, func_name)(torrent)
# rtorrent > 0.9.6 requires first parameter @target
target = ""
getattr(p, func_name)(target, torrent)
if verify_load:
i = 0
@ -233,7 +235,9 @@ class RTorrent:
elif file_type == "url":
finput = torrent
getattr(p, func_name)(finput)
# rtorrent > 0.9.6 requires first parameter @target
target = ""
getattr(p, func_name)(target, finput)
def get_views(self):
p = self._get_conn()

5
py-dev-requirements.txt

@ -1,5 +0,0 @@
nose
rednose
nose-htmloutput
coverage
coveralls

12
requirements-dev.txt

@ -0,0 +1,12 @@
# development requirements
mock>=1.3.0
nose>=1.3.1
nose-exclude>=0.4.1
nose-htmloutput>=0.6.0
coverage
coveralls
pep8>=1.4.6
# you could disable it on travis
rednose>=0.4.0
Loading…
Cancel
Save