metagriffin / globre Goto Github PK
View Code? Open in Web Editor NEWA python glob-like regular expression generation library.
License: GNU General Public License v3.0
A python glob-like regular expression generation library.
License: GNU General Public License v3.0
======================================================================
FAIL: test_compile (globre.test.TestGlobre)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build/globre-0.1.5/globre/test.py", line 126, in test_compile
self.assertEqual(expr.pattern, r'\/foo\/bar\/[^/]*?\.dir\/.*?\.ini')
AssertionError: '/foo/bar/[^/]*?\\.dir/.*?\\.ini' != '\\/foo\\/bar\\/[^/]*?\\.dir\\/.*?\\.ini'
- /foo/bar/[^/]*?\.dir/.*?\.ini
+ \/foo\/bar\/[^/]*?\.dir\/.*?\.ini
? + + + +
======================================================================
FAIL: test_compile_exact (globre.test.TestGlobre)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build/globre-0.1.5/globre/test.py", line 133, in test_compile_exact
self.assertEqual(expr.pattern, r'^\/foo\/bar\/[^/]*?\.dir\/.*?\.ini$')
AssertionError: '^/foo/bar/[^/]*?\\.dir/.*?\\.ini$' != '^\\/foo\\/bar\\/[^/]*?\\.dir\\/.*?\\.ini$'
- ^/foo/bar/[^/]*?\.dir/.*?\.ini$
+ ^\/foo\/bar\/[^/]*?\.dir\/.*?\.ini$
? + + + +
======================================================================
FAIL: test_complete (globre.test.TestGlobre)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build/globre-0.1.5/globre/test.py", line 149, in test_complete
self.assertEqual(
AssertionError: '/foo[0-9a-f]/[^/]*?/bar\\[[^/][^/]\\]/\\D{2,4}/.*?\\.txt' != '\\/foo[0-9a-f]\\/[^/]*?\\/bar\\[[^/][^/]\\]\\/\\D{2,4}\\/.*?\\.txt'
- /foo[0-9a-f]/[^/]*?/bar\[[^/][^/]\]/\D{2,4}/.*?\.txt
+ \/foo[0-9a-f]\/[^/]*?\/bar\[[^/][^/]\]\/\D{2,4}\/.*?\.txt
? + + + + +
======================================================================
FAIL: test_sep_compile (globre.test.TestGlobre)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build/globre-0.1.5/globre/test.py", line 156, in test_sep_compile
self.assertEqual(
AssertionError: '!foo!bar![^!]*?\\.dir!.*?\\.ini' != '\\!foo\\!bar\\![^\\!]*?\\.dir\\!.*?\\.ini'
- !foo!bar![^!]*?\.dir!.*?\.ini
+ \!foo\!bar\![^\!]*?\.dir\!.*?\.ini
? + + + + +
----------------------------------------------------------------------
Ran 12 tests in 0.006s
FAILED (failures=4)
Test failed: <unittest.runner.TextTestResult run=12 errors=0 failures=4>
error: Test failed: <unittest.runner.TextTestResult run=12 errors=0 failures=4>
Using globre
in a Python script prints out the following warning:
python3.8/site-packages/globre-0.1.5-py3.8.egg/globre/__init__.py:121: DeprecationWarning: invalid escape sequence \`
I believe this is because of a bar \
in the docstring for globre.compile
(line [129]https://github.com/metagriffin/globre/blob/master/globre/__init__.py#L129)). Changing it to \\
fixed the warning.
As outlined in ipfs-shipyard/py-ipfs-http-client#77 (comment) we, from the py-ipfs-api
project would like to use globre
instead of our home-grown mod of Python's fnmatch.translate
function to convert glob patterns to regular expressions. Unfortunately for us globre
GPL-only, do linking against it would make our library GPL as well. As a thin API wrapper library that aims to be useful for everybody trying to interface with IPFS from Python (yes, including corporate users) doing that would be unacceptable for us unfortunately. We therefor ask you to re-license this library to LGPL.
@metagriffin already said he's in support of this change.
I therefor ask all contributers of globre
to state their opinion on this including whether their ready to re-release their code:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.