summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-01-02 19:06:27 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-01-02 19:06:27 +0100
commit951d8805aaf7fd81e223896c67869fd34769396b (patch)
tree1f54301a63c6452124fa1af86606489eb5249282
parent76849e6374f2ebf2a1df2ac142a150f82bf2e472 (diff)
Improve showing of entries in the command line
-rw-r--r--lesana/collection.py5
-rw-r--r--lesana/command.py6
2 files changed, 7 insertions, 4 deletions
diff --git a/lesana/collection.py b/lesana/collection.py
index f850a47..1965bc4 100644
--- a/lesana/collection.py
+++ b/lesana/collection.py
@@ -32,7 +32,10 @@ class Entry(object):
label = self.collection.settings.get('entry_label', None)
if label:
t = jinja2.Template(label)
- return t.render(uid=self.uid, **self.data)
+ return t.render(
+ uid=self.uid,
+ fname=self.fname,
+ **self.data)
else:
return self.uid
diff --git a/lesana/command.py b/lesana/command.py
index 4937ccf..0662d93 100644
--- a/lesana/command.py
+++ b/lesana/command.py
@@ -81,7 +81,7 @@ class New(gadona.Command):
)
if edit_file_in_external_editor(filepath):
collection.update_cache([filepath])
- print(new_entry.fname)
+ print(new_entry)
class Edit(gadona.Command):
@@ -98,13 +98,13 @@ class Edit(gadona.Command):
def main(self):
collection = Collection(self.settings.collection)
entry = collection.entry_from_uid(self.settings.uid)
- print(collection.itemdir,entry.fname)
filepath = os.path.join(
collection.itemdir,
entry.fname
)
if edit_file_in_external_editor(filepath):
collection.update_cache([filepath])
+ print(entry)
class Index(gadona.Command):
@@ -169,7 +169,7 @@ class Search(gadona.Command):
' '.join(self.settings.query),
offset,
pagesize):
- print(entry.fname)
+ print(entry)
class Init(gadona.Command):