Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Seedbox-Statistics-For-InfluxDB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Seedbox-Statistics-For-InfluxDB
Commits
13360171
Commit
13360171
authored
8 years ago
by
Matt
Browse files
Options
Downloads
Patches
Plain Diff
Moved HTTP requests into 1 method to cleanup exception handling
parent
8619de9c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
clients/deluge.py
+2
-0
2 additions, 0 deletions
clients/deluge.py
clients/torrentclient.py
+7
-8
7 additions, 8 deletions
clients/torrentclient.py
with
9 additions
and
8 deletions
clients/deluge.py
+
2
−
0
View file @
13360171
...
@@ -72,6 +72,8 @@ class DelugeClient(TorrentClient):
...
@@ -72,6 +72,8 @@ class DelugeClient(TorrentClient):
'
params
'
:
params
'
params
'
:
params
}).
encode
(
'
utf-8
'
)
}).
encode
(
'
utf-8
'
)
self
.
send_log
(
'
Calling Deluge API with method {}
'
.
format
(
method
),
'
debug
'
)
req
=
self
.
_add_common_headers
(
Request
(
self
.
url
,
data
=
data
))
req
=
self
.
_add_common_headers
(
Request
(
self
.
url
,
data
=
data
))
self
.
request_id
+=
1
self
.
request_id
+=
1
...
...
This diff is collapsed.
Click to expand it.
clients/torrentclient.py
+
7
−
8
View file @
13360171
__author__
=
'
barry
'
__author__
=
'
barry
'
import
urllib.request
from
urllib.request
import
urlopen
,
URLError
from
urllib.request
import
Request
,
urlopen
,
URLError
from
urllib.parse
import
urlsplit
from
bs4
import
BeautifulSoup
import
json
import
sys
import
sys
import
re
import
gzip
# TODO Deal with slashes in client URL
# TODO Deal with slashes in client URL
...
@@ -95,7 +89,12 @@ class TorrentClient:
...
@@ -95,7 +89,12 @@ class TorrentClient:
return
res
return
res
def
_process_response
(
self
,
res
):
def
_process_response
(
self
,
res
):
# TODO May only be needed for deluge. Remove from parent if that's the case
"""
Perform response handling for the specific torrent client. Each line requires different processing/decoding of
the response
:param res:
:return:
"""
raise
NotImplementedError
raise
NotImplementedError
def
_authenticate
(
self
):
def
_authenticate
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment