Code Monkey home page Code Monkey logo

flametree's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flametree's Issues

Weasyprint test fails

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

Recursion exception on deep zip files

  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" ) )

Backslash in file/dir path is not escaped

  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

Probably path error in Windows

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.