gongliyu / arlib Goto Github PK
View Code? Open in Web Editor NEWCommon interfaces for archive manipulation
License: MIT License
Common interfaces for archive manipulation
License: MIT License
The trick to make the register function a decorator has been moved to a new package decoutils, so use decoutils.decorator_with_args can reduce the size of code.
Add function is_archive to determine if the path is a archive or not from the filenames and modes,
>>> is_archive('a.tar.gz', 'w')
True
>>> is_archive('a.txt', 'w')
False
When the mode is 'r', it should check the existence of the archive file
If the input is a file stream opened from an archive file, the following Error will be raised:
E AttributeError: '_FileInFile' object has no attribute 'mode'
In [8]: arlib.open(fname, engine=None)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-3bdb2fa1c9dc> in <module>
----> 1 arlib.open(fname, engine=None)
~src\arlib\arlib\__init__.py in open(*args, **kwargs)
661 """Shortcut to constructor of :class:`Archive`
662 """
--> 663 return Archive(*args, **kwargs)
~src\arlib\arlib\__init__.py in __init__(self, path, *args, **kwargs)
517 self._need_close = False
518 else:
--> 519 self._file = zipfile.ZipFile(path, *args, **kwargs)
520
521 @property
TypeError: __init__() got an unexpected keyword argument 'engine'
Add a global function arlib.open as a shortcut of the constructor of arlib.Archive.
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.