edinburgh-genome-foundry / flametree Goto Github PK
View Code? Open in Web Editor NEW:fire: Python file and zip operations made easy
License: MIT License
:fire: Python file and zip operations made easy
License: MIT License
File "C:\Py36\lib\site-packages\flametree\Directory.py", line 34, in __init__
self._dir(dirname, replace=False)
File "C:\Py36\lib\site-packages\flametree\Directory.py", line 74, in _dir
file_manager=self._file_manager)
File "C:\Py36\lib\site-packages\flametree\Directory.py", line 31, in __init__
for filename in self._file_manager.list_files(self):
File "C:\Py36\lib\site-packages\flametree\ZipFileManager.py", line 77, in list_files
for name in self.reader.namelist()
File "C:\Py36\lib\site-packages\flametree\ZipFileManager.py", line 77, in <listcomp>
for name in self.reader.namelist()
File "C:\Py36\lib\re.py", line 172, in match
return _compile(pattern, flags).match(string)
File "C:\Py36\lib\re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
File "C:\Py36\lib\sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
File "C:\Py36\lib\sre_parse.py", line 856, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)
File "C:\Py36\lib\sre_parse.py", line 415, in _parse_sub
itemsappend(_parse(source, state, verbose))
File "C:\Py36\lib\sre_parse.py", line 763, in _parse
p = _parse_sub(source, state, sub_verbose)
File "C:\Py36\lib\sre_parse.py", line 415, in _parse_sub
itemsappend(_parse(source, state, verbose))
File "C:\Py36\lib\sre_parse.py", line 610, in _parse
item = subpattern[-1:]
File "C:\Py36\lib\sre_parse.py", line 165, in __getitem__
return SubPattern(self.pattern, self.data[index])
RecursionError: maximum recursion depth exceeded while calling a Python object
Caused by jar file with alot of folders inside each other.
Library = flametree.Directory( "library.jar", file_manager=flametree.ZipFileManager( "library.jar" ) )
File "C:\Py36\lib\site-packages\flametree\Directory.py", line 77, in _dir
file_manager=self._file_manager)
File "C:\Py36\lib\site-packages\flametree\Directory.py", line 33, in __init__
for dirname in self._file_manager.list_dirs(self):
File "C:\Py36\lib\site-packages\flametree\ZipFileManager.py", line 94, in list_dirs
for name in self.reader.namelist()
File "C:\Py36\lib\site-packages\flametree\ZipFileManager.py", line 94, in <listcomp>
for name in self.reader.namelist()
File "C:\Py36\lib\re.py", line 172, in match
return _compile(pattern, flags).match(string)
File "C:\Py36\lib\re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
File "C:\Py36\lib\sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
File "C:\Py36\lib\sre_parse.py", line 856, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)
File "C:\Py36\lib\sre_parse.py", line 415, in _parse_sub
itemsappend(_parse(source, state, verbose))
File "C:\Py36\lib\sre_parse.py", line 501, in _parse
code = _escape(source, this, state)
File "C:\Py36\lib\sre_parse.py", line 401, in _escape
raise source.error("bad escape %s" % escape, len(escape))
sre_constants.error: bad escape \c at position 3
test code:
import flametree
chromats = flametree.file_tree('chromats.zip')
chromats._all_files[0].open('rb')
thrown error:
KeyError: "There is no item named 'chromats\\\\seq11.ab1' in the archive"
On NixOS the build process for the packages fails. I'm not sure if it's an issue with the setup or the test.
============================= test session starts ==============================
platform linux -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /build/source
collected 7 items
tests/test_basics.py .... [ 57%]
tests/test_third_parties.py F.. [100%]
=================================== FAILURES ===================================
_______________________________ test_weasyprint ________________________________
tmpdir = local('/build/pytest-of-nixbld/pytest-0/test_weasyprint0')
def test_weasyprint(tmpdir):
path = str(tmpdir)
root = file_tree(str(tmpdir)) # or 'archive.zip' to write in an archive.
html = weasyprint.HTML(string="<b>Hello</b> world!", base_url=".")
html.write_pdf(root._dir("pdfs")._file("test.pdf"))
with open(os.path.join(path, "pdfs", "test.pdf"), "rb") as f:
filesize = len(f.read())
> assert 8000 < filesize
E assert 8000 < 5456
tests/test_third_parties.py:26: AssertionError
=========================== short test summary info ============================
FAILED tests/test_third_parties.py::test_weasyprint - assert 8000 < 5456
========================= 1 failed, 6 passed in 1.97s ==========================
Thanks
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.