File: hooks.py

package info (click to toggle)
gpodder 2.20.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,228 kB
  • sloc: python: 16,951; makefile: 183; ansic: 140; sh: 97
file content (34 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
# Example hooks script for gPodder.
# To use, copy it as a Python script into ~/.config/gpodder/hooks/mySetOfHooks.py
# See the module "gpodder.hooks" for a description of when each hook
# gets called and what the parameters of each hook are.

import gpodder

from gpodder.liblogger import log

class gPodderHooks(object):
    def __init__(self):
        log('Example extension is initializing.')

    def on_podcast_updated(self, podcast):
        log(u'on_podcast_updated(%s)' % podcast.title)

    def on_podcast_save(self, podcast):
        log(u'on_podcast_save(%s)' % podcast.title)

    def on_episode_downloaded(self, episode):
        log(u'on_episode_downloaded(%s)' % episode.title)

    def on_episode_save(self, episode):
        log(u'on_episode_save(%s)' % episode.title)

    def on_file_copied_to_filesystem(self, mp3playerdevice, from_file, to_file):
        log(u'on_file_copied_to_filesystem(%s, %s)' % (from_file, to_file))

    def on_file_copied_to_ipod(self, ipoddevice, from_file):
        log(u'on_file_copied_to_ipod(%s)' % from_file)

    def on_file_copied_to_mtp(self, mtpdevice, from_file, to_file):
        log(u'on_file_copied_to_mtp(%s, %s)' % (from_file, to_file))