text
stringlengths
0
828
returns the request thread.
""""""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return cls._get_currency_by_id_with_http_info(currency_id, **kwargs)
else:
(data) = cls._get_currency_by_id_with_http_info(currency_id, **kwargs)
return data"
4885,"def list_all_currencies(cls, **kwargs):
""""""List Currencies
Return a list of Currencies
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.list_all_currencies(async=True)
>>> result = thread.get()
:param async bool
:param int page: page number
:param int size: page size
:param str sort: page order
:return: page[Currency]
If the method is called asynchronously,
returns the request thread.
""""""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return cls._list_all_currencies_with_http_info(**kwargs)
else:
(data) = cls._list_all_currencies_with_http_info(**kwargs)
return data"
4886,"def replace_currency_by_id(cls, currency_id, currency, **kwargs):
""""""Replace Currency
Replace all attributes of Currency
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.replace_currency_by_id(currency_id, currency, async=True)
>>> result = thread.get()
:param async bool
:param str currency_id: ID of currency to replace (required)
:param Currency currency: Attributes of currency to replace (required)
:return: Currency
If the method is called asynchronously,
returns the request thread.
""""""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return cls._replace_currency_by_id_with_http_info(currency_id, currency, **kwargs)
else:
(data) = cls._replace_currency_by_id_with_http_info(currency_id, currency, **kwargs)
return data"
4887,"def update_currency_by_id(cls, currency_id, currency, **kwargs):
""""""Update Currency
Update attributes of Currency
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_currency_by_id(currency_id, currency, async=True)
>>> result = thread.get()
:param async bool
:param str currency_id: ID of currency to update. (required)
:param Currency currency: Attributes of currency to update. (required)
:return: Currency
If the method is called asynchronously,
returns the request thread.
""""""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return cls._update_currency_by_id_with_http_info(currency_id, currency, **kwargs)
else:
(data) = cls._update_currency_by_id_with_http_info(currency_id, currency, **kwargs)
return data"
4888,"def run_cmd(cmd, out=os.path.devnull, err=os.path.devnull):
""""""Runs an external command
:param list cmd: Command to run.
:param str out: Output file
:param str err: Error file
:raises: RuntimeError
""""""
logger.debug(' '.join(cmd))
with open(out, 'w') as hout:
proc = subprocess.Popen(cmd, stdout=hout, stderr=subprocess.PIPE)
err_msg = proc.communicate()[1].decode()
with open(err, 'w') as herr:
herr.write(str(err_msg))
msg = '({}) {}'.format(' '.join(cmd), err_msg)
if proc.returncode != 0:
logger.error(msg)
raise RuntimeError(msg)"
4889,"def run_cmd_if_file_missing(cmd, fname, out=os.path.devnull, err=os.path.devnull):
""""""Runs an external command if file is absent.
:param list cmd: Command to run.
:param str fname: Path to the file, which existence is being checked.
:param str out: Output file