Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CouchPotatoServer
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
CouchPotatoServer
Commits
c2453bb0
Commit
c2453bb0
authored
Jan 1, 2013
by
Travis La Marr
Committed by
Ruud
Jan 4, 2013
Browse files
Options
Downloads
Patches
Plain Diff
Added Windows Phone SuperToasty Notifier
parent
a3a2c8da
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
couchpotato/core/notifications/toasty/__init__.py
+32
-0
32 additions, 0 deletions
couchpotato/core/notifications/toasty/__init__.py
couchpotato/core/notifications/toasty/main.py
+30
-0
30 additions, 0 deletions
couchpotato/core/notifications/toasty/main.py
with
62 additions
and
0 deletions
couchpotato/core/notifications/toasty/__init__.py
0 → 100644
+
32
−
0
View file @
c2453bb0
from
.main
import
Toasty
def
start
():
return
Toasty
()
config
=
[{
'
name
'
:
'
toasty
'
,
'
groups
'
:
[
{
'
tab
'
:
'
notifications
'
,
'
name
'
:
'
toasty
'
,
'
options
'
:
[
{
'
name
'
:
'
enabled
'
,
'
default
'
:
0
,
'
type
'
:
'
enabler
'
,
},
{
'
name
'
:
'
api_key
'
,
'
label
'
:
'
Device ID
'
,
},
{
'
name
'
:
'
on_snatch
'
,
'
default
'
:
0
,
'
type
'
:
'
bool
'
,
'
advanced
'
:
True
,
'
description
'
:
'
Also send message when movie is snatched.
'
,
},
],
}
],
}]
This diff is collapsed.
Click to expand it.
couchpotato/core/notifications/toasty/main.py
0 → 100644
+
30
−
0
View file @
c2453bb0
from
couchpotato.core.helpers.encoding
import
toUnicode
from
couchpotato.core.logger
import
CPLog
from
couchpotato.core.notifications.base
import
Notification
from
httplib
import
HTTPConnection
from
urllib
import
urlencode
import
traceback
log
=
CPLog
(
__name__
)
class
Toasty
(
Notification
):
def
notify
(
self
,
message
=
''
,
data
=
{},
listener
=
None
):
if
self
.
isDisabled
():
return
data
=
{
'
title
'
:
self
.
default_title
,
'
text
'
:
toUnicode
(
message
),
'
sender
'
:
toUnicode
(
"
CouchPotato
"
),
'
image
'
:
'
https://raw.github.com/RuudBurger/CouchPotatoServer/master/couchpotato/static/images/homescreen.png
'
,
}
try
:
http_handler
=
HTTPConnection
(
"
api.supertoasty.com
"
)
http_handler
.
request
(
"
GET
"
,
"
/notify/
"
+
self
.
conf
(
'
api_key
'
)
+
"
?
"
+
urlencode
(
data
))
log
.
info
(
'
Toasty notifications sent.
'
)
return
True
except
:
log
.
error
(
'
Toasty failed: %s
'
,
traceback
.
format_exc
())
return
False
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