summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):