yamlscript 0.1.95__tar.gz → 0.1.97__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yamlscript-0.1.95/lib/yamlscript.egg-info → yamlscript-0.1.97}/PKG-INFO +1 -1
- {yamlscript-0.1.95 → yamlscript-0.1.97}/ReadMe.md +11 -12
- {yamlscript-0.1.95 → yamlscript-0.1.97}/lib/yamlscript/__init__.py +2 -2
- {yamlscript-0.1.95 → yamlscript-0.1.97/lib/yamlscript.egg-info}/PKG-INFO +1 -1
- {yamlscript-0.1.95 → yamlscript-0.1.97}/setup.py +1 -1
- {yamlscript-0.1.95 → yamlscript-0.1.97}/.long_description.md +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/MANIFEST.in +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/lib/yamlscript.egg-info/SOURCES.txt +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/lib/yamlscript.egg-info/dependency_links.txt +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/lib/yamlscript.egg-info/requires.txt +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/lib/yamlscript.egg-info/top_level.txt +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/setup.cfg +0 -0
- {yamlscript-0.1.95 → yamlscript-0.1.97}/test/test.py +0 -0
|
@@ -17,15 +17,14 @@ names-url =:
|
|
|
17
17
|
"https://raw.githubusercontent.com/dominictarr/\
|
|
18
18
|
random-name/master/first-names.json"
|
|
19
19
|
|
|
20
|
-
name-list =:
|
|
20
|
+
name-list =: names-url:curl:json/load
|
|
21
21
|
|
|
22
22
|
# Data object with literal keys and generated values:
|
|
23
|
-
name::
|
|
24
|
-
aka:: name-list
|
|
23
|
+
name:: iname-list:shuffle:first
|
|
24
|
+
aka:: name-list:rand-nth
|
|
25
25
|
age:: &num 2 * 3 * 7
|
|
26
|
-
color:: &hue
|
|
27
|
-
|
|
28
|
-
.first()
|
|
26
|
+
color:: &hue
|
|
27
|
+
rand-nth: qw(red green blue yellow)
|
|
29
28
|
title:: "$(*num) shades of $(*hue)."
|
|
30
29
|
```
|
|
31
30
|
|
|
@@ -74,12 +73,12 @@ CLI binary `ys` to run:
|
|
|
74
73
|
$ ys --compile file.ys
|
|
75
74
|
(let
|
|
76
75
|
[names-url "https://raw.githubusercontent.com/dominictarr/random-name/master/first-names.json"
|
|
77
|
-
name-list (
|
|
76
|
+
name-list (json/load (curl names-url))]
|
|
78
77
|
(%
|
|
79
|
-
"name" (
|
|
78
|
+
"name" (first (shuffle name-list))
|
|
80
79
|
"aka" (rand-nth name-list)
|
|
81
80
|
"age" (_& 'num (mul+ 2 3 7))
|
|
82
|
-
"color" (_& 'hue (
|
|
81
|
+
"color" (_& 'hue (rand-nth (qw red green blue yellow)))
|
|
83
82
|
"title" (str (_** 'num) " shades of " (_** 'hue) ".")))
|
|
84
83
|
```
|
|
85
84
|
|
|
@@ -126,7 +125,7 @@ $ python prog.py
|
|
|
126
125
|
You can install this module like any other Python module:
|
|
127
126
|
|
|
128
127
|
```bash
|
|
129
|
-
|
|
128
|
+
pip install yamlscript
|
|
130
129
|
```
|
|
131
130
|
|
|
132
131
|
but you will need to have a system install of `libyamlscript.so`.
|
|
@@ -134,14 +133,14 @@ but you will need to have a system install of `libyamlscript.so`.
|
|
|
134
133
|
One simple way to do that is with:
|
|
135
134
|
|
|
136
135
|
```bash
|
|
137
|
-
|
|
136
|
+
curl https://yamlscript.org/install | bash
|
|
138
137
|
```
|
|
139
138
|
|
|
140
139
|
> Note: The above command will install the latest version of the YAMLScript
|
|
141
140
|
command line utility, `ys`, and the shared library, `libyamlscript.so`, into
|
|
142
141
|
`~/local/bin` and `~/.local/lib` respectively.
|
|
143
142
|
|
|
144
|
-
See https://
|
|
143
|
+
See <https://yamlscript.org/doc/install/> for more info.
|
|
145
144
|
|
|
146
145
|
## See Also
|
|
147
146
|
|
|
@@ -16,7 +16,7 @@ object that the YAMLScript code evaluates to.
|
|
|
16
16
|
# This value is automatically updated by 'make bump'.
|
|
17
17
|
# The version number is used to find the correct shared library file.
|
|
18
18
|
# We currently only support binding to an exact version of libyamlscript.
|
|
19
|
-
yamlscript_version = '0.1.
|
|
19
|
+
yamlscript_version = '0.1.97'
|
|
20
20
|
|
|
21
21
|
import os, sys
|
|
22
22
|
import ctypes
|
|
@@ -40,7 +40,7 @@ def find_libyamlscript_path():
|
|
|
40
40
|
"Unsupported platform '%s' for yamlscript." % sys.platform)
|
|
41
41
|
|
|
42
42
|
# We currently bind to an exact version of libyamlscript.
|
|
43
|
-
# eg 'libyamlscript.so.0.1.
|
|
43
|
+
# eg 'libyamlscript.so.0.1.97'
|
|
44
44
|
libyamlscript_name = \
|
|
45
45
|
"libyamlscript.%s.%s" % (so, yamlscript_version)
|
|
46
46
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|