Beispiel #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
Beispiel #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
Beispiel #3
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
     raise NotAvailableError(str(leaf))