Merge lp:~coalwater/stipple/coalwater-branch into lp:stipple

Proposed by Mohammad AbuShady
Status: Merged
Merged at revision: 22
Proposed branch: lp:~coalwater/stipple/coalwater-branch
Merge into: lp:stipple
Diff against target: 57 lines (+53/-0)
1 file modified
plugins/rhythmbox.py (+53/-0)
To merge this branch: bzr merge lp:~coalwater/stipple/coalwater-branch
Reviewer Review Type Date Requested Status
Duane Hinnen Approve
Review via email: mp+61951@code.launchpad.net

Description of the change

Added a Rhythmbox plugin to sync the rating of the songs

To post a comment you must log in.
Revision history for this message
Duane Hinnen (duanedesign) wrote :

looks good, tested and seems to work great.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'plugins/rhythmbox.py'
--- plugins/rhythmbox.py 1970-01-01 00:00:00 +0000
+++ plugins/rhythmbox.py 2011-05-23 10:52:27 +0000
@@ -0,0 +1,53 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""
5#!/usr/bin/env python
6# -*- coding: utf-8 -*-
7#
8# stipple.py - sync files across several computers.
9#
10# Copyright 2010 Duane Hinnen, Marcos Vanetta
11#
12# This program is free software: you can redistribute it and/or modify it
13# under the terms of the GNU General Public License version 3, as published
14# by the Free Software Foundation.
15#
16# This program is distributed in the hope that it will be useful, but
17# WITHOUT ANY WARRANTY; without even the implied warranties of
18# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
19# PURPOSE. See the GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License along
22# with this program. If not, see <http://www.gnu.org/licenses/>.
23#
24"""
25import os
26from core.stipple import PluginBase
27
28RHYTHMBOX_CONFIG = os.path.expanduser("~") + "/.local/share/rhythmbox/playlists.xml"
29
30class Plugin(PluginBase):
31
32 def __init__ (self):
33 self.name = "Rhythmbox"
34 self.prog_name = "rhythmbox"
35 self.record_name = "rhythmbox"
36 self.icon = None
37
38
39 def sync(self):
40 with open(RHYTHMBOX_CONFIG, "r") as rhythmbox:
41 br = rhythmbox.read()
42 rhythmbox.close()
43 self.saveDotFile(br)
44 return True
45
46 def restore(self):
47 cad = self.recoverDotFile()
48 print cad
49 if cad:
50 with open(RHYTHMBOX_CONFIG, "w") as rhythmbox:
51 rhythmbox.write(cad)
52 rhythmbox.close()
53 return True

Subscribers

People subscribed via source and target branches