[meld] recent: Typing information for read()
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] recent: Typing information for read()
- Date: Sun, 6 Jan 2019 02:57:32 +0000 (UTC)
commit c1a4a9b672e15603113ae092a2b241ff95084459
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Dec 11 07:09:06 2018 +1000
recent: Typing information for read()
This also removes docstring that's now captured by the typing.
meld/recent.py | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/meld/recent.py b/meld/recent.py
index 9cb49ce7..efc21908 100644
--- a/meld/recent.py
+++ b/meld/recent.py
@@ -29,6 +29,7 @@ import enum
import os
import sys
import tempfile
+from typing import List, Tuple
from gi.repository import Gio
from gi.repository import GLib
@@ -116,12 +117,8 @@ class RecentFiles:
recent_metadata.is_private = True
self.recent_manager.add_full(gfile.get_uri(), recent_metadata)
- def read(self, uri):
- """Read stored comparison from URI
-
- Returns the comparison type, the URIs involved and the comparison
- flags.
- """
+ def read(self, uri: str) -> Tuple[RecentType, List[Gio.File]]:
+ """Read stored comparison from URI"""
comp_gfile = Gio.File.new_for_uri(uri)
comp_path = comp_gfile.get_path()
if not comp_gfile.query_exists(None) or not comp_path:
@@ -145,10 +142,10 @@ class RecentFiles:
if config.has_option("Comparison", "uris"):
uris = config.get("Comparison", "uris").split(";")
- gfiles = tuple(Gio.File.new_for_uri(u) for u in uris)
+ gfiles = [Gio.File.new_for_uri(u) for u in uris]
else:
paths = config.get("Comparison", "paths").split(";")
- gfiles = tuple(Gio.File.new_for_path(p) for p in paths)
+ gfiles = [Gio.File.new_for_path(p) for p in paths]
return recent_type, gfiles
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]