summaryrefslogtreecommitdiff
path: root/python-plover-stroke.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-18 04:14:25 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-18 04:14:25 +0000
commit6b6eaf8bdffa243baa32b3e3f83d6dc1f0732a51 (patch)
tree13e165200707c9134728c3ed5a9d421cd178ac90 /python-plover-stroke.spec
parent9aa6e14c03df919d1d4d66437148edb5726fcfa1 (diff)
automatic import of python-plover-stroke
Diffstat (limited to 'python-plover-stroke.spec')
-rw-r--r--python-plover-stroke.spec402
1 files changed, 402 insertions, 0 deletions
diff --git a/python-plover-stroke.spec b/python-plover-stroke.spec
new file mode 100644
index 0000000..e55d1ab
--- /dev/null
+++ b/python-plover-stroke.spec
@@ -0,0 +1,402 @@
+%global _empty_manifest_terminate_build 0
+Name: python-plover-stroke
+Version: 1.1.0
+Release: 1
+Summary: Stroke handling helper library for Plover
+License: GNU General Public License v2 or later (GPLv2+)
+URL: https://github.com/benoit-pierre/plover_stroke
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/cc/53/92635d8bf00b883bfbc6ab9dd48b6df2ed01c241379fe99f063a41530cab/plover_stroke-1.1.0.tar.gz
+
+Requires: python3-pytest
+
+%description
+# Plover Stroke
+
+Helper class for working with steno strokes.
+
+Usage:
+
+``` python
+# Setup:
+
+from plover_stroke import BaseStroke
+
+class Stroke(BaseStroke):
+ pass
+
+Stroke.setup(
+ # System keys.
+ '''
+ #
+ S- T- K- P- W- H- R-
+ A- O-
+ *
+ -E -U
+ -F -R -P -B -L -G -T -S -D -Z
+ '''.split(),
+ # Implicit hyphen keys (optional, automatically
+ # deduced from system keys if not passed).
+ 'A- O- * -E -U'.split(),
+ # Number bar key and numbers keys (optional).
+ '#', {
+ 'S-': '1-',
+ 'T-': '2-',
+ 'P-': '3-',
+ 'H-': '4-',
+ 'A-': '5-',
+ 'O-': '0-',
+ '-F': '-6',
+ '-P': '-7',
+ '-L': '-8',
+ '-T': '-9',
+ })
+
+# Creating strokes:
+
+Stroke(56)
+# => KPW
+Stroke(('-F', 'S-', '-S', 'A-', '*'))
+# => SA*FS
+Stroke('R-')
+# => R
+Stroke('L-')
+# => invalid, raise a ValueError
+
+# Methods:
+
+s = Stroke('STK')
+
+s.keys()
+# => ('S-', 'T-', 'K-')
+s.is_number()
+# => False
+int(s)
+# => 14
+s == 0b00000000000000000001110
+# => True
+
+# Strokes can be compared:
+sorted(map(Stroke, 'AOE ST-PB *Z # R-R'.split()))
+# => [#, ST-PB, R-R, AOE, *Z]
+```
+
+
+## Release history
+
+### 1.1.0
+
+* add `feral_number_key` support: when set to `True`, allow the number key
+ letter anywhere when parsing steno (e.g. `18#`, `#18`, and `1#8` are all
+ valid and equivalent, as per the RTF/CRE spec).
+
+
+### 1.0.1
+
+* fix exception in case of invalid keys mask
+
+
+### 1.0.0
+
+* drop `Stroke.xrange` and `Stroke.xsuffixes` methods
+* `Stroke.keys()` now return a tuple
+* fix corner case when parsing steno (`RR` -> `R-R`)
+* fix RTFCRE when numbers are involved (align with Plover's behavior)
+* fix implicit hyphen handling when numbers are involved
+* renamed `Stroke.isnumber` to `Stroke.is_number`
+* speed up implementation through a C extension
+
+
+### 0.4.0
+
+* fix stroke comparison
+
+
+### 0.3.3
+
+* fix `python_requires` package metadata
+
+
+### 0.3.2
+
+* first public release
+
+
+%package -n python3-plover-stroke
+Summary: Stroke handling helper library for Plover
+Provides: python-plover-stroke
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+BuildRequires: python3-cffi
+BuildRequires: gcc
+BuildRequires: gdb
+%description -n python3-plover-stroke
+# Plover Stroke
+
+Helper class for working with steno strokes.
+
+Usage:
+
+``` python
+# Setup:
+
+from plover_stroke import BaseStroke
+
+class Stroke(BaseStroke):
+ pass
+
+Stroke.setup(
+ # System keys.
+ '''
+ #
+ S- T- K- P- W- H- R-
+ A- O-
+ *
+ -E -U
+ -F -R -P -B -L -G -T -S -D -Z
+ '''.split(),
+ # Implicit hyphen keys (optional, automatically
+ # deduced from system keys if not passed).
+ 'A- O- * -E -U'.split(),
+ # Number bar key and numbers keys (optional).
+ '#', {
+ 'S-': '1-',
+ 'T-': '2-',
+ 'P-': '3-',
+ 'H-': '4-',
+ 'A-': '5-',
+ 'O-': '0-',
+ '-F': '-6',
+ '-P': '-7',
+ '-L': '-8',
+ '-T': '-9',
+ })
+
+# Creating strokes:
+
+Stroke(56)
+# => KPW
+Stroke(('-F', 'S-', '-S', 'A-', '*'))
+# => SA*FS
+Stroke('R-')
+# => R
+Stroke('L-')
+# => invalid, raise a ValueError
+
+# Methods:
+
+s = Stroke('STK')
+
+s.keys()
+# => ('S-', 'T-', 'K-')
+s.is_number()
+# => False
+int(s)
+# => 14
+s == 0b00000000000000000001110
+# => True
+
+# Strokes can be compared:
+sorted(map(Stroke, 'AOE ST-PB *Z # R-R'.split()))
+# => [#, ST-PB, R-R, AOE, *Z]
+```
+
+
+## Release history
+
+### 1.1.0
+
+* add `feral_number_key` support: when set to `True`, allow the number key
+ letter anywhere when parsing steno (e.g. `18#`, `#18`, and `1#8` are all
+ valid and equivalent, as per the RTF/CRE spec).
+
+
+### 1.0.1
+
+* fix exception in case of invalid keys mask
+
+
+### 1.0.0
+
+* drop `Stroke.xrange` and `Stroke.xsuffixes` methods
+* `Stroke.keys()` now return a tuple
+* fix corner case when parsing steno (`RR` -> `R-R`)
+* fix RTFCRE when numbers are involved (align with Plover's behavior)
+* fix implicit hyphen handling when numbers are involved
+* renamed `Stroke.isnumber` to `Stroke.is_number`
+* speed up implementation through a C extension
+
+
+### 0.4.0
+
+* fix stroke comparison
+
+
+### 0.3.3
+
+* fix `python_requires` package metadata
+
+
+### 0.3.2
+
+* first public release
+
+
+%package help
+Summary: Development documents and examples for plover-stroke
+Provides: python3-plover-stroke-doc
+%description help
+# Plover Stroke
+
+Helper class for working with steno strokes.
+
+Usage:
+
+``` python
+# Setup:
+
+from plover_stroke import BaseStroke
+
+class Stroke(BaseStroke):
+ pass
+
+Stroke.setup(
+ # System keys.
+ '''
+ #
+ S- T- K- P- W- H- R-
+ A- O-
+ *
+ -E -U
+ -F -R -P -B -L -G -T -S -D -Z
+ '''.split(),
+ # Implicit hyphen keys (optional, automatically
+ # deduced from system keys if not passed).
+ 'A- O- * -E -U'.split(),
+ # Number bar key and numbers keys (optional).
+ '#', {
+ 'S-': '1-',
+ 'T-': '2-',
+ 'P-': '3-',
+ 'H-': '4-',
+ 'A-': '5-',
+ 'O-': '0-',
+ '-F': '-6',
+ '-P': '-7',
+ '-L': '-8',
+ '-T': '-9',
+ })
+
+# Creating strokes:
+
+Stroke(56)
+# => KPW
+Stroke(('-F', 'S-', '-S', 'A-', '*'))
+# => SA*FS
+Stroke('R-')
+# => R
+Stroke('L-')
+# => invalid, raise a ValueError
+
+# Methods:
+
+s = Stroke('STK')
+
+s.keys()
+# => ('S-', 'T-', 'K-')
+s.is_number()
+# => False
+int(s)
+# => 14
+s == 0b00000000000000000001110
+# => True
+
+# Strokes can be compared:
+sorted(map(Stroke, 'AOE ST-PB *Z # R-R'.split()))
+# => [#, ST-PB, R-R, AOE, *Z]
+```
+
+
+## Release history
+
+### 1.1.0
+
+* add `feral_number_key` support: when set to `True`, allow the number key
+ letter anywhere when parsing steno (e.g. `18#`, `#18`, and `1#8` are all
+ valid and equivalent, as per the RTF/CRE spec).
+
+
+### 1.0.1
+
+* fix exception in case of invalid keys mask
+
+
+### 1.0.0
+
+* drop `Stroke.xrange` and `Stroke.xsuffixes` methods
+* `Stroke.keys()` now return a tuple
+* fix corner case when parsing steno (`RR` -> `R-R`)
+* fix RTFCRE when numbers are involved (align with Plover's behavior)
+* fix implicit hyphen handling when numbers are involved
+* renamed `Stroke.isnumber` to `Stroke.is_number`
+* speed up implementation through a C extension
+
+
+### 0.4.0
+
+* fix stroke comparison
+
+
+### 0.3.3
+
+* fix `python_requires` package metadata
+
+
+### 0.3.2
+
+* first public release
+
+
+%prep
+%autosetup -n plover-stroke-1.1.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-plover-stroke -f filelist.lst
+%dir %{python3_sitearch}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1
+- Package Spec generated