MCPcopy Create free account
hub / github.com/dashingsoft/pyarmor-webui / _handle_pack_options

Method _handle_pack_options

handler8.py:200–231  ·  view source on GitHub ↗
(self, src, options)

Source from the content-addressed store, hash-verified

198 return data
199
200 def _handle_pack_options(self, src, options):
201 result = []
202 for item in options:
203 for x in shell_split(item):
204 if x:
205 result.extend(x.split('=', 1) if x.find('=') > 0 else [x])
206 i = 0
207 n = len(result)
208
209 def _quote_path(s):
210 if not os.path.isabs(s):
211 s = os.path.join(src, s)
212 s = s.replace('\\', '/')
213 return ("'%s'" % s) if s.find(' ') > -1 else s
214
215 while i < n:
216 v = str(result[i])
217 if v in ('--onefile', '-F', '--onefolder', '-D', '--name', '-N',
218 '--noconfirm', '-y', '--distpath', '--specpath'):
219 raise RuntimeError('Option "%s" could not be used here' % v)
220 if v in ('--add-data', '--add-binary'):
221 i += 1
222 if result[i].find(os.pathsep) == -1:
223 result[i] += os.pathsep + '.'
224 result[i] = _quote_path(result[i])
225 elif v in ('-i', '--icon', '-p', '--paths', '--runtime-hook',
226 '--additional-hooks-dir', '--version-file',
227 '-m', '--manifest', '-r', '--resource'):
228 i += 1
229 result[i] = _quote_path(result[i])
230 i += 1
231 return result
232
233 @enter_temp_path
234 def _build_target(self, path, args, debug=False):

Callers 1

_build_targetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected