8000 utarfile: Metadata and example. · micropython/micropython-lib@94b2afd · GitHub
[go: up one dir, main page]

Skip to content

Commit 94b2afd

Browse files
author
Paul Sokolovsky
committed
utarfile: Metadata and example.
1 parent b85a246 commit 94b2afd

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

utarfile/example-extract.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
import os
3+
import shutil
4+
import utarfile
5+
6+
t = utarfile.TarFile(sys.argv[1])
7+
for i in t:
8+
print(i)
9+
if i.type == utarfile.DIRTYPE:
10+
os.makedirs(i.name)
11+
else:
12+
f = t.extractfile(i)
13+
shutil.copyfileobj(f, open(i.name, "wb"))

utarfile/metadata.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
srctype = micropython-lib
2+
type = module
3+
version = 0.1
4+
author = Paul Sokolovsky
5+
long_desc = Lightweight tarfile module subset

utarfile/setup.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import sys
2+
# Remove current dir from sys.path, otherwise setuptools will peek up our
3+
# module instead of system.
4+
sys.path.pop(0)
5+
from setuptools import setup
6+
7+
8+
setup(name='micropython-utarfile',
9+
version='0.1',
10+
description='utarfile module for MicroPython',
11+
long_description='Lightweight tarfile module subset',
12+
url='https://github.com/micropython/micropython/issues/405',
13+
author='Paul Sokolovsky',
14+
author_email='micro-python@googlegroups.com',
15+
maintainer='MicroPython Developers',
16+
maintainer_email='micro-python@googlegroups.com',
17+
license='MIT',
18+
py_modules=['utarfile'])

0 commit comments

Comments
 (0)
0