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

Subscribers

People subscribed via source and target branches