From 8975f560fc104bb0bff2b4b03215ec03876ce389f7a9e2e7c795000a3912f3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Thu, 14 Mar 2019 12:52:09 +0000 Subject: [PATCH] Accepting request 685011 from home:mimi_vx fix OBS-URL: https://build.opensuse.org/request/show/685011 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyjsparser?expand=0&rev=1 --- .gitattributes | 23 +++++++++++++++ .gitignore | 1 + LICENSE | 21 ++++++++++++++ README.md | 37 ++++++++++++++++++++++++ fix_version.patch | 12 ++++++++ pyjsparser-2.5.2.tar.gz | 3 ++ python-pyjsparser.changes | 5 ++++ python-pyjsparser.spec | 59 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 161 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 fix_version.patch create mode 100644 pyjsparser-2.5.2.tar.gz create mode 100644 python-pyjsparser.changes create mode 100644 python-pyjsparser.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2213e6b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Piotr Dabkowski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2275af0 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# pyjsparser +Fast JavaScript parser - manual translation of esprima.js to python. Takes 1 second to parse whole angular.js library so parsing speed is about 100k characters per second which makes it the fastest and most comprehensible JavaScript parser for python out there. + +Supports whole ECMAScript 5.1 and parts of ECMAScript 6. If you need full ECMA 6 support I recomment trying out [this](https://github.com/Kronuz/esprima-python) parser by Kronuz. + +# Installation + + pip install pyjsparser + +# Example + + >>> from pyjsparser import PyJsParser + >>> p = PyJsParser() + >>> p.parse('var $ = "Hello!"') + { + "type": "Program", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "$" + }, + "init": { + "type": "Literal", + "value": "Hello!", + "raw": '"Hello!"' + } + } + ], + "kind": "var" + } + ] + } diff --git a/fix_version.patch b/fix_version.patch new file mode 100644 index 0000000..41ea51b --- /dev/null +++ b/fix_version.patch @@ -0,0 +1,12 @@ +Index: pyjsparser-2.5.2/pyjsparser/__init__.py +=================================================================== +--- pyjsparser-2.5.2.orig/pyjsparser/__init__.py ++++ pyjsparser-2.5.2/pyjsparser/__init__.py +@@ -1,4 +1,4 @@ + __all__ = ['PyJsParser', 'parse', 'JsSyntaxError'] + __author__ = 'Piotr Dabkowski' +-__version__ = '2.2.0' +-from .parser import PyJsParser, parse, JsSyntaxError +\ No newline at end of file ++__version__ = '2.5.2' ++from .parser import PyJsParser, parse, JsSyntaxError diff --git a/pyjsparser-2.5.2.tar.gz b/pyjsparser-2.5.2.tar.gz new file mode 100644 index 0000000..93d05e3 --- /dev/null +++ b/pyjsparser-2.5.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4a659df3db42a2ff9fbc961eb6d4076a0b945e1aadfc20d48f913ad5dca011d +size 24039 diff --git a/python-pyjsparser.changes b/python-pyjsparser.changes new file mode 100644 index 0000000..49106b9 --- /dev/null +++ b/python-pyjsparser.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Wed Mar 13 15:47:24 UTC 2019 - Ondřej Súkup + +- Initial commit +- add fix_version.patch diff --git a/python-pyjsparser.spec b/python-pyjsparser.spec new file mode 100644 index 0000000..8b338c1 --- /dev/null +++ b/python-pyjsparser.spec @@ -0,0 +1,59 @@ +# +# spec file for package python-pyjsparser +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-pyjsparser +Version: 2.5.2 +Release: 0 +License: MIT +Summary: Fast javascript parser (based on esprimajs) +Url: https://github.com/PiotrDabkowski/pyjsparser +Group: Development/Languages/Python +Source: https://files.pythonhosted.org/packages/source/p/pyjsparser/pyjsparser-%{version}.tar.gz +Source1: https://raw.githubusercontent.com/PiotrDabkowski/pyjsparser/master/LICENSE +Source2: https://raw.githubusercontent.com/PiotrDabkowski/pyjsparser/master/README.md +Patch0: fix_version.patch +BuildRequires: python-rpm-macros +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildArch: noarch + +%python_subpackages + +%description +Fast JavaScript parser - manual translation of esprima.js to python +Supports whole ECMAScript 5.1 and parts of ECMAScript 6. + +%prep +%setup -q -n pyjsparser-%{version} +%patch0 -p1 +cp %{S:1} . +cp %{S:2} . + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%files %{python_files} +%license LICENSE +%doc README.md +%{python_sitelib}/* + +%changelog