aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tagit/apps/port_data.py12
-rw-r--r--tagit/tiles/info.py10
2 files changed, 17 insertions, 5 deletions
diff --git a/tagit/apps/port_data.py b/tagit/apps/port_data.py
index cda2d63..fc11b4d 100644
--- a/tagit/apps/port_data.py
+++ b/tagit/apps/port_data.py
@@ -1,8 +1,20 @@
+
+# standard imports
import os
+import pickle
+
+# tagit imports
from tagit.utils import ns
from tagit.utils.bsfs import URI
+# load data
def add_port_data(store):
+ with open(os.path.join(os.path.dirname(__file__), 'port-data.pkl'), 'rb') as ifile:
+ for triple in pickle.load(ifile):
+ store._backend._graph.add(triple)
+
+
+def add_port_data2(store):
# tags
t_hello = store.node(ns.bsfs.Tag, URI('http://example.com/me/tag#hello')) \
.set(ns.bst.label, 'hello')
diff --git a/tagit/tiles/info.py b/tagit/tiles/info.py
index 725e098..a5eacdf 100644
--- a/tagit/tiles/info.py
+++ b/tagit/tiles/info.py
@@ -11,7 +11,7 @@ from collections import OrderedDict
from kivy.lang import Builder
# tagit imports
-from tagit.utils import ttime, ns
+from tagit.utils import ttime, ns, magnitude_fmt
from tagit.widgets.browser import BrowserAwareMixin
# inner-module imports
@@ -30,7 +30,7 @@ Builder.load_string('''
tooltip: 'Key properties of the cursor item'
# assuming 7 info items
default_size: None, 7*self.font_size + 6*5
- keywidth: min(65, self.width * 0.4)
+ keywidth: min(75, self.width * 0.4)
''')
@@ -64,16 +64,16 @@ class Info(TileTabular, BrowserAwareMixin):
ns.bsm.t_created,
ns.bse.filesize,
ns.bse.filename,
- ns.bse.comment,
+ (ns.bse.tag, ns.bst.label),
)
self.tabledata = OrderedDict({
'Date' : ttime.from_timestamp_utc(
preds.get(ns.bsm.t_created, ttime.timestamp_min)).strftime('%d.%m.%y %H:%M'),
#'Size' : f'{preds.get(ns.bse.width, "?")} x {preds.get(ns.bse.height, "?")}',
#'ISO' : preds.get(ns.bse.iso, '?'),
- 'Filesize' : preds.get(ns.bse.filesize, 'n/a'),
+ 'Filesize' : magnitude_fmt(preds.get(ns.bse.filesize, 0)),
'Filename' : preds.get(ns.bse.filename, 'n/a'),
- 'Comment' : '; '.join(preds.get(ns.bse.comment, [])),
+ 'Tags' : ', '.join(sorted(preds.get((ns.bse.tag, ns.bst.label), []))),
#'Exposure' : f'1 / {preds.get(ns.bse.exposure, 0):0.2f}',
#'Aperture' : preds.get(ns.bse.aperture, '?'),
#'Fx' : preds.get(ns.bse.focal_length_35, '?'),