python3 setup.py install --prefix=/usr does not work.
packages are always installed into /usr/local in default.
Change-Id: I3e30b704b5a30e49a029b7ed4c1bad8c327f8dd9
Signed-off-by: xuhy <huayong.xu@samsung.com>
-debian/tmp/usr/bin/mic /usr/bin
-debian/tmp/usr/lib/* /usr/lib
+debian/tmp/usr/local/bin/mic /usr/bin
+debian/tmp/usr/local/lib/* /usr/lib
debian/tmp/usr/share/* /usr/share
debian/tmp/etc/* /etc
#!/usr/bin/make -f
%:
dh $@ --with python3 --buildsystem=pybuild
+
build:
make man
+
override_dh_auto_install:
dh_auto_install
# Installing package
install -m644 doc/mic.1 $(CURDIR)/debian/tmp/usr/share/man/man1
install -m755 etc/bash_completion.d/mic.sh $(CURDIR)/debian/tmp/etc/bash_completion.d/
install -m755 etc/zsh_completion.d/_mic $(CURDIR)/debian/tmp/etc/zsh_completion.d/_mic
- python3 setup.py install --root=$(CURDIR)/debian/tmp --prefix=/usr
+ python3 setup.py install --root=$(CURDIR)/debian/tmp --prefix=/usr/local
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
+
override_dh_auto_test:
def get(url, params=None, **kwargs):
- """Sends a GET request.
+ r"""Sends a GET request.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
def options(url, **kwargs):
- """Sends a OPTIONS request.
+ r"""Sends a OPTIONS request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
def head(url, **kwargs):
- """Sends a HEAD request.
+ r"""Sends a HEAD request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
def post(url, data=None, json=None, **kwargs):
- """Sends a POST request.
+ r"""Sends a POST request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
def put(url, data=None, **kwargs):
- """Sends a PUT request.
+ r"""Sends a PUT request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
def patch(url, data=None, **kwargs):
- """Sends a PATCH request.
+ r"""Sends a PATCH request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
def delete(url, **kwargs):
- """Sends a DELETE request.
+ r"""Sends a DELETE request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
return content
def json(self, **kwargs):
- """Returns the json-encoded content of a response, if any.
+ r"""Returns the json-encoded content of a response, if any.
:param \*\*kwargs: Optional arguments that ``json.loads`` takes.
"""
class HTTPConnectionPool(ConnectionPool, RequestMethods):
- """
+ r"""
Thread-safe connection pool for one host.
:param host:
def urlopen(self, method, url, body=None, headers=None, retries=None,
redirect=True, assert_same_host=True, timeout=_Default,
pool_timeout=None, release_conn=None, **response_kw):
- """
+ r"""
Get a connection from the pool and perform an HTTP request. This is the
lowest level call for making a request, so you'll need to specify all
the raw details.
def connection_from_url(url, **kw):
- """
+ r"""
Given a url, return an :class:`.ConnectionPool` instance of its host.
This is a shortcut for not having to parse out the scheme, host, and port
class PoolManager(RequestMethods):
- """
+ r"""
Allows for arbitrary requests while transparently keeping track of
necessary connection pools for you.
return resp
def get(self, url, **kwargs):
- """Sends a GET request. Returns :class:`Response` object.
+ r"""Sends a GET request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
return self.request('GET', url, **kwargs)
def options(self, url, **kwargs):
- """Sends a OPTIONS request. Returns :class:`Response` object.
+ r"""Sends a OPTIONS request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
return self.request('OPTIONS', url, **kwargs)
def head(self, url, **kwargs):
- """Sends a HEAD request. Returns :class:`Response` object.
+ r"""Sends a HEAD request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
return self.request('HEAD', url, **kwargs)
def post(self, url, data=None, json=None, **kwargs):
- """Sends a POST request. Returns :class:`Response` object.
+ r"""Sends a POST request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
return self.request('POST', url, data=data, json=json, **kwargs)
def put(self, url, data=None, **kwargs):
- """Sends a PUT request. Returns :class:`Response` object.
+ r"""Sends a PUT request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
return self.request('PUT', url, data=data, **kwargs)
def patch(self, url, data=None, **kwargs):
- """Sends a PATCH request. Returns :class:`Response` object.
+ r"""Sends a PATCH request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
return self.request('PATCH', url, data=data, **kwargs)
def delete(self, url, **kwargs):
- """Sends a DELETE request. Returns :class:`Response` object.
+ r"""Sends a DELETE request. Returns :class:`Response` object.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
inline_argv = m.group(1).strip()
if ptype == 'mic':
- m2 = re.search('(?P<format>\w+)', inline_argv)
+ m2 = re.search(r'(?P<format>\w+)', inline_argv)
elif ptype == 'mic2':
- m2 = re.search('(-f|--format(=)?)\s*(?P<format>\w+)',
+ m2 = re.search(r'(-f|--format(=)?)\s*(?P<format>\w+)',
inline_argv)
else:
return None
with open(ksfile, 'r') as rf:
first_line = rf.readline()
- mic_re = '^#\s*-\*-mic-options-\*-\s+(.*)\s+-\*-mic-options-\*-'
- mic2_re = '^#\s*-\*-mic2-options-\*-\s+(.*)\s+-\*-mic2-options-\*-'
+ mic_re = r'^#\s*-\*-mic-options-\*-\s+(.*)\s+-\*-mic-options-\*-'
+ mic2_re = r'^#\s*-\*-mic2-options-\*-\s+(.*)\s+-\*-mic2-options-\*-'
result = parse_magic_line(mic_re, first_line, 'mic') \
or parse_magic_line(mic2_re, first_line, 'mic2')
return
- parser = configparser.SafeConfigParser()
+ parser = configparser.ConfigParser()
parser.read(siteconf)
for section in parser.sections():
# check and normalize the scheme of proxy url
if self.create['proxy']:
- m = re.match('^(\w+)://.*', self.create['proxy'])
+ m = re.match(r'^(\w+)://.*', self.create['proxy'])
if m:
scheme = m.group(1)
if scheme not in ('http', 'https', 'ftp', 'socks'):
# auto select backend
with open(_path(conf), 'r') as rf:
conf_str = rf.read()
- conf_str = re.sub("pkgmgr\s*=\s*.*", "pkgmgr=auto", conf_str)
+ conf_str = re.sub(r"pkgmgr\s*=\s*.*", "pkgmgr=auto", conf_str)
with open(_path(conf), 'w') as wf:
wf.write(conf_str)
# auto select backend
with open(_path(conf), 'r') as rf:
conf_str = rf.read()
- conf_str = re.sub("pkgmgr\s*=\s*.*", "pkgmgr=auto", conf_str)
+ conf_str = re.sub(r"pkgmgr\s*=\s*.*", "pkgmgr=auto", conf_str)
with open(_path(conf), 'w') as wf:
wf.write(conf_str)
from mic.utils.safeurl import SafeURL
-RPM_RE = re.compile("(.*)\.(.*) (.*)-(.*)")
+RPM_RE = re.compile(r"(.*)\.(.*) (.*)-(.*)")
RPM_FMT = "%(name)s.%(arch)s %(version)s-%(release)s"
-SRPM_RE = re.compile("(.*)-(\d+.*)-(\d+\.\d+).src.rpm")
+SRPM_RE = re.compile(r"(.*)-(\d+.*)-(\d+\.\d+).src.rpm")
def build_name(kscfg, release=None, prefix = None, suffix = None):
def get_image_type(path):
def _get_extension_name(path):
- match = re.search("(?<=\.)\w+$", path)
+ match = re.search(r"(?<=\.)\w+$", path)
if match:
return match.group(0)
else:
rpmloc = h
hdr = readRpmHeader(self.ts, h)
- m = re.match("(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
+ m = re.match(r"(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
if m:
pkgname = m.group(1)
else:
except:
rpmloc = h
- m = re.match("(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
+ m = re.match(r"(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
if m:
pkgname = m.group(1)
else:
except:
rpmloc = h
- m = re.match("(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
+ m = re.match(r"(.*)-(\d+.*)-(\d+\.\d+)\.(.+)\.rpm", os.path.basename(rpmloc))
if m:
pkgname = m.group(1)
else:
# 2 3400531968B 3656384511B 255852544B primary linux-swap(v1)
# 3 3656384512B 3720347647B 63963136B primary fat16 boot, lba
- partition_info = re.split("\s+", line)
+ partition_info = re.split(r"\s+", line)
size = partition_info[3].split("B")[0]