kopia lustrzana https://github.com/micropython/micropython-lib
utarfile: Metadata and example.
rodzic
b85a24693b
commit
94b2afdf8b
|
@ -0,0 +1,13 @@
|
|||
import sys
|
||||
import os
|
||||
import shutil
|
||||
import utarfile
|
||||
|
||||
t = utarfile.TarFile(sys.argv[1])
|
||||
for i in t:
|
||||
print(i)
|
||||
if i.type == utarfile.DIRTYPE:
|
||||
os.makedirs(i.name)
|
||||
else:
|
||||
f = t.extractfile(i)
|
||||
shutil.copyfileobj(f, open(i.name, "wb"))
|
|
@ -0,0 +1,5 @@
|
|||
srctype = micropython-lib
|
||||
type = module
|
||||
version = 0.1
|
||||
author = Paul Sokolovsky
|
||||
long_desc = Lightweight tarfile module subset
|
|
@ -0,0 +1,18 @@
|
|||
import sys
|
||||
# Remove current dir from sys.path, otherwise setuptools will peek up our
|
||||
# module instead of system.
|
||||
sys.path.pop(0)
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
setup(name='micropython-utarfile',
|
||||
version='0.1',
|
||||
description='utarfile module for MicroPython',
|
||||
long_description='Lightweight tarfile module subset',
|
||||
url='https://github.com/micropython/micropython/issues/405',
|
||||
author='Paul Sokolovsky',
|
||||
author_email='micro-python@googlegroups.com',
|
||||
maintainer='MicroPython Developers',
|
||||
maintainer_email='micro-python@googlegroups.com',
|
||||
license='MIT',
|
||||
py_modules=['utarfile'])
|
Ładowanie…
Reference in New Issue