summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxj9 <xj9@sunshinegardens.org>2020-06-03 13:48:05 -0600
committerxj9 <xj9@sunshinegardens.org>2020-06-03 13:48:05 -0600
commit9935122c0068b90362a50ab25254e5ee5e1bf4ee (patch)
treef610dfd8e3b5fedc40daabd077fe54cb4ebed78e
parentc235028485c8b4de7ebf68f7302b395e566be6f9 (diff)
organize repo
-rw-r--r--README.md10
-rw-r--r--bbnet/bbnet.1.md0
-rw-r--r--bfs/bfs-server0
-rw-r--r--bfs/bfs-server.1.md0
-rw-r--r--bfs/bfs.1.md (renamed from bfs.1.md)0
-rwxr-xr-xbfs/bfs.sh (renamed from bfs)0
-rw-r--r--bfs/networking.7.md (renamed from networking.7.md)0
-rw-r--r--grid/Makefile (renamed from Makefile)0
-rw-r--r--grid/grid.1.md (renamed from grid.1.md)0
-rwxr-xr-xgrid/grid.sh (renamed from grid)0
-rw-r--r--grid/hello-world.c (renamed from hello-world.c)0
-rw-r--r--rlog/lib/formats/README.md36
-rw-r--r--rlog/lib/formats/arvelie.py0
-rw-r--r--rlog/lib/formats/indental.py71
-rw-r--r--rlog/lib/formats/metric_time.py0
-rw-r--r--rlog/lib/formats/neralie.py0
-rw-r--r--rlog/lib/formats/tablatal.py13
-rw-r--r--rlog/requirements.txt5
-rw-r--r--rlog/rlog.1.md0
-rw-r--r--rlog/rlog.sh24
20 files changed, 152 insertions, 7 deletions
diff --git a/README.md b/README.md
index 45ce9de..0f25c6c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,4 @@
-# INDEX
+# tracker concepts
-- [grid(1)](grid.1.md)
-- [bfs(1)](bfs.1.md)
-
-## SEE ALSO
-
-[issue tracker](https://git.heropunch.io/%251BtG8h6Oh6uI7kjnZkvK20wqLrCZlbbFxrZ3e6zRWro%3D.sha256/issues) \ No newline at end of file
+this repo contains demo programs which demonstrate "complex" features with small
+amounts of simple code.
diff --git a/bbnet/bbnet.1.md b/bbnet/bbnet.1.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bbnet/bbnet.1.md
diff --git a/bfs/bfs-server b/bfs/bfs-server
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bfs/bfs-server
diff --git a/bfs/bfs-server.1.md b/bfs/bfs-server.1.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bfs/bfs-server.1.md
diff --git a/bfs.1.md b/bfs/bfs.1.md
index b1443af..b1443af 100644
--- a/bfs.1.md
+++ b/bfs/bfs.1.md
diff --git a/bfs b/bfs/bfs.sh
index b4af30b..b4af30b 100755
--- a/bfs
+++ b/bfs/bfs.sh
diff --git a/networking.7.md b/bfs/networking.7.md
index a2032c0..a2032c0 100644
--- a/networking.7.md
+++ b/bfs/networking.7.md
diff --git a/Makefile b/grid/Makefile
index 023371c..023371c 100644
--- a/Makefile
+++ b/grid/Makefile
diff --git a/grid.1.md b/grid/grid.1.md
index a1a0dcb..a1a0dcb 100644
--- a/grid.1.md
+++ b/grid/grid.1.md
diff --git a/grid b/grid/grid.sh
index 63f1bac..63f1bac 100755
--- a/grid
+++ b/grid/grid.sh
diff --git a/hello-world.c b/grid/hello-world.c
index 36e44ec..36e44ec 100644
--- a/hello-world.c
+++ b/grid/hello-world.c
diff --git a/rlog/lib/formats/README.md b/rlog/lib/formats/README.md
new file mode 100644
index 0000000..35b2645
--- /dev/null
+++ b/rlog/lib/formats/README.md
@@ -0,0 +1,36 @@
+formats
+=======
+
+parsers and serializers for a variety of data interchange formats.
+
+## supported formats
+
+- [ ] arvelie
+- [x] indental
+- [ ] metric time
+- [ ] neralie
+- [ ] tablatal
+
+## abstract format interface
+
+> Warning: AbstractFormat is an implied abstract class, described here for
+> illustrative purposes. There is no actual class with this name, but all other
+> format classes implement subset of the functionality described here.
+
+### `formats.AbstractFormat`
+
+`loads(str) ⇒ dict`
+
+parses the given string.
+
+`load(stream) ⇒ dict`
+
+parses the given stream.
+
+`dumps(obj) ⇒ str`
+
+serializes the given object.
+
+`dumps(obj, stream) ⇒ str`
+
+serializes the given object, writing to the given stream.
diff --git a/rlog/lib/formats/arvelie.py b/rlog/lib/formats/arvelie.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/rlog/lib/formats/arvelie.py
diff --git a/rlog/lib/formats/indental.py b/rlog/lib/formats/indental.py
new file mode 100644
index 0000000..c14d76a
--- /dev/null
+++ b/rlog/lib/formats/indental.py
@@ -0,0 +1,71 @@
+try:
+ import ure
+except ImportError:
+ import re
+ ure = re
+
+try:
+ from uio import StringIO
+except ImportError:
+ from io import StringIO
+
+comment = ure.compile(r"^#.*$")
+name = ure.compile(r"^[A-Za-z0-9].+$")
+item = ure.compile(r"^ +.+ : .+$")
+list_item = ure.compile(r"^ +.+$")
+
+def _parse(ndtl_io):
+ """
+ indental stringio parser
+
+ https://wiki.xxiivv.com/site/indental.html
+ """
+ result = {}
+ current_name = None
+ in_list = None
+ for line in ndtl_io:
+ if comment.match(line):
+ continue
+ elif name.match(line):
+ in_list = None
+ current_name = line.strip()
+ result[current_name] = {}
+ elif item.match(line) and current_name:
+ in_list = None
+ key, value = line.strip().split(" : ")
+ result[current_name][key.strip()] = value.strip()
+ elif list_item.match(line) and current_name:
+ if in_list is None:
+ in_list = line.strip()
+ result[current_name][in_list] = []
+ else:
+ result[current_name][in_list].append(line.strip())
+ return result
+
+
+def parse(ndtl):
+ """
+ parse the indental string and return an object
+ """
+ result = {}
+ with StringIO(ndtl) as fd:
+ result.update(_parse(fd))
+ return result
+
+
+def parse_file(filename):
+ """
+ read and parse an indental file
+ """
+ result = {}
+ with open(filename) as fd:
+ result.update(_parse(fd))
+ return result
+
+def dumps(obj):
+ """
+ serialize `obj` to an indental document. keep in mind that indental does not
+ support arbitrary dictionaries. this routine will raise a `ValueError` if it
+ cannot represent the given obj in indental.
+ """
+ pass
diff --git a/rlog/lib/formats/metric_time.py b/rlog/lib/formats/metric_time.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/rlog/lib/formats/metric_time.py
diff --git a/rlog/lib/formats/neralie.py b/rlog/lib/formats/neralie.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/rlog/lib/formats/neralie.py
diff --git a/rlog/lib/formats/tablatal.py b/rlog/lib/formats/tablatal.py
new file mode 100644
index 0000000..0109dda
--- /dev/null
+++ b/rlog/lib/formats/tablatal.py
@@ -0,0 +1,13 @@
+try:
+ import ure
+except ImportError:
+ import re
+ ure = re
+
+
+def parse():
+ pass
+
+
+def parse_file():
+ pass
diff --git a/rlog/requirements.txt b/rlog/requirements.txt
new file mode 100644
index 0000000..e086f96
--- /dev/null
+++ b/rlog/requirements.txt
@@ -0,0 +1,5 @@
+base58check==1.0.2
+cffi==1.14.0
+pycparser==2.20
+PyNaCl==1.4.0
+six==1.15.0
diff --git a/rlog/rlog.1.md b/rlog/rlog.1.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/rlog/rlog.1.md
diff --git a/rlog/rlog.sh b/rlog/rlog.sh
new file mode 100644
index 0000000..72b945e
--- /dev/null
+++ b/rlog/rlog.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+"""
+UNLICENSE
+
+RLOG_KEY=~/.ssb/secret
+rlog commit <message file|stdin>
+"""
+# import .formats
+import base58check
+import nacl.encoding
+import nacl.signing
+
+def sign_message(signing_key, message):
+ signed = signing_key.sign(b"Attack at Dawn")
+ verify_key = signing_key.verify_key
+ verify_key_hex = verify_key.encode(encoder=nacl.encoding.HexEncoder)
+ print(verify_key_hex, verify_key)
+ return '{key}\t{sig}\t{ts}\t{index}\t{prev_key}\t{message}\n'.format(
+ )
+
+if __name__ == '__main__':
+ msg = sign_message(
+ signing_key=nacl.signing.SigningKey.generate()
+ )