- Update to 2.7.1:

* no upstream changelog
- Rebase fix_version.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyjsparser?expand=0&rev=7
This commit is contained in:
Tomáš Chvátal 2019-05-25 13:12:23 +00:00 committed by Git OBS Bridge
parent 2499868206
commit e34d27536a
6 changed files with 23 additions and 55 deletions

View File

@ -1,37 +0,0 @@
# 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"
}
]
}

View File

@ -1,12 +1,13 @@
Index: pyjsparser-2.5.2/pyjsparser/__init__.py Index: pyjsparser-2.7.1/pyjsparser/__init__.py
=================================================================== ===================================================================
--- pyjsparser-2.5.2.orig/pyjsparser/__init__.py --- pyjsparser-2.7.1.orig/pyjsparser/__init__.py
+++ pyjsparser-2.5.2/pyjsparser/__init__.py +++ pyjsparser-2.7.1/pyjsparser/__init__.py
@@ -1,4 +1,4 @@ @@ -1,5 +1,5 @@
__all__ = ['PyJsParser', 'parse', 'JsSyntaxError'] __all__ = ['PyJsParser', 'parse', 'JsSyntaxError', 'pyjsparserdata']
__author__ = 'Piotr Dabkowski' __author__ = 'Piotr Dabkowski'
-__version__ = '2.2.0' -__version__ = '2.2.0'
-from .parser import PyJsParser, parse, JsSyntaxError +__version__ = '2.7.1'
from .parser import PyJsParser, parse, JsSyntaxError
-from . import pyjsparserdata
\ No newline at end of file \ No newline at end of file
+__version__ = '2.5.2' +from . import pyjsparserdata
+from .parser import PyJsParser, parse, JsSyntaxError

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e4a659df3db42a2ff9fbc961eb6d4076a0b945e1aadfc20d48f913ad5dca011d
size 24039

BIN
pyjsparser-2.7.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat May 25 13:09:24 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 2.7.1:
* no upstream changelog
- Rebase fix_version.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 14 16:38:43 UTC 2019 - Jan Engelhardt <jengelh@inai.de> Thu Mar 14 16:38:43 UTC 2019 - Jan Engelhardt <jengelh@inai.de>

View File

@ -18,21 +18,19 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyjsparser Name: python-pyjsparser
Version: 2.5.2 Version: 2.7.1
Release: 0 Release: 0
Summary: Javascript parser based on esprimajs Summary: Javascript parser based on esprimajs
License: MIT License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
Url: https://github.com/PiotrDabkowski/pyjsparser URL: https://github.com/PiotrDabkowski/pyjsparser
Source: https://files.pythonhosted.org/packages/source/p/pyjsparser/pyjsparser-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/p/pyjsparser/pyjsparser-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/PiotrDabkowski/pyjsparser/master/LICENSE Source1: https://raw.githubusercontent.com/PiotrDabkowski/pyjsparser/master/LICENSE
Source2: https://raw.githubusercontent.com/PiotrDabkowski/pyjsparser/master/README.md
Patch0: fix_version.patch Patch0: fix_version.patch
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildArch: noarch BuildArch: noarch
%python_subpackages %python_subpackages
%description %description
@ -42,8 +40,7 @@ It supports the whole of ECMAScript 5.1 and parts of ECMAScript 6.
%prep %prep
%setup -q -n pyjsparser-%{version} %setup -q -n pyjsparser-%{version}
%patch0 -p1 %patch0 -p1
cp %{S:1} . cp %{SOURCE1} .
cp %{S:2} .
%build %build
%python_build %python_build