Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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))