~ubuntu-branches/debian/wheezy/quodlibet/wheezy

« back to all changes in this revision

Viewing changes to formats/remote.py

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2009-01-30 23:55:34 UTC
  • mto: (18.1.1 squeeze) (2.1.9 sid)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090130235534-45857nfsgobw4apc
Tags: upstream-2.0
ImportĀ upstreamĀ versionĀ 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2004-2005 Joe Wreschnig, Michael Urman
2
 
#
3
 
# This program is free software; you can redistribute it and/or modify
4
 
# it under the terms of the GNU General Public License version 2 as
5
 
# published by the Free Software Foundation
6
 
#
7
 
# $Id: remote.py 3634 2006-07-14 19:38:41Z piman $
8
 
 
9
 
from formats._audio import AudioFile
10
 
from util.uri import URI
11
 
 
12
 
extensions = []
13
 
 
14
 
class RemoteFile(AudioFile):
15
 
    is_file = False
16
 
    fill_metadata = True
17
 
 
18
 
    format = "Remote File"
19
 
 
20
 
    def __init__(self, uri):
21
 
        self["~uri"] = self["~filename"] = str(URI(uri))
22
 
        self["~mountpoint"] = ""
23
 
        self.sanitize(uri)
24
 
 
25
 
    def rename(self, newname): pass
26
 
    def reload(self): pass
27
 
    def exists(self): return True
28
 
    def valid(self): return True
29
 
    def mounted(self): return True
30
 
 
31
 
    def write(self):
32
 
        raise TypeError("RemoteFiles do not support writing!")
33
 
 
34
 
    def can_change(self, k = None):
35
 
        if k is None: return []
36
 
        else: return False
37
 
 
38
 
    key = property(lambda self: self["~uri"])
39
 
 
40
 
info = RemoteFile