예제 #1
0
 def activate(self, leaf):
     gfile = Gio.File.new_for_uri(leaf.object["location"])
     path = gfile.get_path()
     if path:
         result = FileLeaf(path)
         if result.is_valid():
             return result
예제 #2
0
 def activate(self, leaf):
     gfile = Gio.File.new_for_uri(leaf.object["location"])
     try:
         path = gfile.get_path()
     except Exception as exc:
         # On utf-8 decode error
         # FIXME: Unrepresentable path
         raise OperationError(exc)
     if path:
         result = FileLeaf(path)
         if result.is_valid():
             return result
예제 #3
0
파일: rhythmbox.py 프로젝트: engla/kupfer
 def activate(self, leaf):
     gfile = Gio.File.new_for_uri(leaf.object["location"])
     try:
         path = gfile.get_path()
     except Exception as exc:
         # On utf-8 decode error
         # FIXME: Unrepresentable path
         raise OperationError(exc)
     if path:
         result = FileLeaf(path)
         if result.is_valid():
             return result
     raise NotAvailableError(str(leaf))