File tree Expand file tree Collapse file tree 1 file changed +3
-33
lines changed Expand file tree Collapse file tree 1 file changed +3
-33
lines changed Original file line number Diff line number Diff line change 1
- def upip_import (mod , sub = None ):
2
- try :
3
- mod_ = mod
4
- if sub :
5
- mod_ += "_" + sub
6
- return __import__ ("upip_" + mod_ )
7
- except ImportError :
8
- m = __import__ (mod )
9
- if sub :
10
- return getattr (m , sub )
11
- return m
12
-
13
- sys = upip_import ("sys" )
1
+ import sys
14
2
import uos as os
15
3
import uerrno as errno
4
+ import ujson as json
16
5
import uzlib
17
-
18
- try :
19
- tarfile = upip_import ("utarfile" )
20
- except ImportError :
21
- tarfile = upip_import ("tarfile" )
22
- try :
23
- json = upip_import ("ujson" )
24
- except ImportError :
25
- json = upip_import ("json" )
6
+ import upip_utarfile as tarfile
26
7
27
8
28
9
DEFAULT_MICROPYPATH = "~/.micropython/lib:/usr/lib/micropython"
@@ -168,17 +149,6 @@ def fatal(msg):
168
149
print (msg )
169
150
sys .exit (1 )
170
151
171
- def gzdecompress (package_fname ):
172
- f = open (package_fname , "rb" )
173
- zipdata = f .read ()
174
- data = gzip .decompress (zipdata )
175
- return data
176
-
177
- def gzdecompress_ (package_fname ):
178
- os .system ("gzip -d -c %s > ungz" % package_fname )
179
- with open ("ungz" , "rb" ) as f :
180
- return f .read ()
181
-
182
152
def install_pkg (pkg_spec , install_path ):
183
153
data = get_pkg_metadata (pkg_spec )
184
154
You can’t perform that action at this time.
0 commit comments