code
stringlengths
1
18.2k
def adjust_column_width(worksheet): """Adjust column width in worksheet. Args: worksheet: worksheet to be adjusted """ dims = {} padding = 1 for row in worksheet.rows: for cell in row: if not cell.value: continue dims[cell.column] = max( dims.get(cell.column, 0), len(str(cell.value)) ) for col, value in list(dims.items...
def get_ap_info(ipaddress, auth, url): """ function takes input of ipaddress to RESTFUL call to HP IMC :param ipaddress: The current IP address of the Access Point at time of query. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth...
dict >>> from pyhpeimc.auth import * >>> from pyhpeimc.wsm.apinfo import * >>> auth = IMCAuth("http://", "10.101.0.203", "8080", "admin", "admin") >>> ap_info = get_ap_info('10.101.0.170',auth.creds, auth.url) >>> assert type(ap_info) is dict >>> assert len(ap_info) == 20 >>> assert 'acDevId' in ap_info >>> assert 'acI...
>>> assert 'ipAddress' in ap_info >>> assert 'isFit' in ap_info >>> assert 'label' in ap_info >>> assert 'location' in ap_info >>> assert 'locationList' in ap_info >>> assert 'macAddress' in ap_info >>> assert 'onlineClientCount' in ap_info >>> assert 'serialId' in ap_info >>> assert 'softwareVersion' in ap_info >>> as...
ap_info """ get_ap_info_url = "/imcrs/wlan/apInfo/queryApBasicInfoByCondition?ipAddress=" + str(ipaddress) f_url = url + get_ap_info_url payload = None r = requests.get(f_url, auth=auth, headers=HEADERS) # creates the URL using the payload variable as the contents # print(r.status_code) try: if r.status_code == 200: if...
def sessions(status, access_key, id_only, all): ''' List and manage compute sessions. ''' fields = [ ('Session ID', 'sess_id'), ] with Session() as session: if is_admin(session): fields.append(('Owner', 'access_key')) if not id_only: fields.extend([ ('Image', 'image'), ('Tag', 'tag'), ('Created At', 'created_at',), ('T...
def execute_paginated_query(limit, offset): q = ''' query($limit:Int!, $offset:Int!, $ak:String, $status:String) { compute_session_list( limit:$limit, offset:$offset, access_key:$ak, status:$status) { items { $fields } total_count } }''' q = textwrap.dedent(q).strip() q = q.replace('$fields', ' '.join(item[1] for item ...
sys.exit(1) return resp['compute_session_list'] def round_mem(items): for item in items: if 'mem_cur_bytes' in item: item['mem_cur_bytes'] = round(item['mem_cur_bytes'] / 2 ** 20, 1) if 'mem_max_bytes' in item: item['mem_max_bytes'] = round(item['mem_max_bytes'] / 2 ** 20, 1) return items def _generate_paginated_result...
Exception as e: print_error(e) sys.exit(1) offset += interval total_count = result['total_count'] items = result['items'] items = round_mem(items) if id_only: yield '\n'.join([item['sess_id'] for item in items]) + '\n' else: table = tabulate([item.values() for item in items], headers=(item[0] for item in fields)) if no...
with Session() as session: paginating_interval = 10 if all: click.echo_via_pager(_generate_paginated_results(paginating_interval)) else: result = execute_paginated_query(paginating_interval, offset=0) total_count = result['total_count'] if total_count == 0: print('There are no compute sessions currently {0}.' .format(s...
by using --all option.")
def session(sess_id_or_alias): ''' Show detailed information for a running compute session. SESSID: Session id or its alias. ''' fields = [ ('Session ID', 'sess_id'), ('Role', 'role'), ('Image', 'image'), ('Tag', 'tag'), ('Created At', 'created_at'), ('Terminated At', 'terminated_at'), ('Agent', 'agent'), ('Status', 's...
RX Bytes', 'net_rx_bytes'), ('Network TX Bytes', 'net_tx_bytes'), ('IO Read Bytes', 'io_read_bytes'), ('IO Write Bytes', 'io_write_bytes'), ('IO Max Scratch Size', 'io_max_scratch_size'), ('IO Current Scratch Size', 'io_cur_scratch_size'), ('CPU Using (%)', 'cpu_using'), ] if is_legacy_server(): del fields[3] q = 'quer...
resp = session.Admin.query(q, v) except Exception as e: print_error(e) sys.exit(1) if resp['compute_session']['sess_id'] is None: print('There is no such running compute session.') return print('Session detail:\n---------------') for i, value in enumerate(resp['compute_session'].values()): if fields[i][1] in ['mem_cur_...
def create(cls, endpoint_name, json_body, original_response): """Factory for creating the correct type of Response based on the data. Args: endpoint_name (str) - The endpoint of the request, such as "property/value" json_body - The response body in json format. original_response (response object) - server response retu...
original_response) prefix = endpoint_name.split("/")[0] if prefix == "block": return BlockResponse(endpoint_name, json_body, original_response) if prefix == "zip": return ZipCodeResponse(endpoint_name, json_body, original_response) if prefix == "msa": return MsaResponse(endpoint_name, json_body, original_response) retu...
def get_object_errors(self): """Gets a list of business error message strings for each of the requested objects that had a business error. If there was no error, returns an empty list Returns: List of strings """ if self._object_errors is None: self._object_errors = [{str(o): o.get_errors()} for o in self.objects() if ...
def has_object_error(self): """Returns true if any requested object had a business logic error, otherwise returns false Returns: boolean """ if self._has_object_error is None: # scan the objects for any business error codes self._has_object_error = next( (True for o in self.objects() if o.has_error()), False) return se...
def rate_limits(self): """Returns a list of rate limit details.""" if not self._rate_limits: self._rate_limits = utilities.get_rate_limits(self.response) return self._rate_limits
def check_imc_creds(auth, url): """Function takes input of auth class object auth object and URL and returns a BOOL of TRUE if the authentication was successful. >>> auth = IMCAuth("http://", "10.101.0.203", "8080", "admin", "admin") >>> check_imc_creds(auth.creds, auth.url) True """ test_url = '/imcrs' f_url = url + t...
str(error) + " test_imc_creds: An Error has occured"
def print_to_file(object_name): """ Function takes in object of type str, list, or dict and prints out to current working directory as pyoutput.txt :param: Object: object of type str, list, or dict :return: No return. Just prints out to file handler and save to current working directory as pyoutput.txt """ with open('p...
if isinstance(object_name, dict): output = json.dumps(object, indent=4) if isinstance(object_name, str): output = object_name filehandler.write(output)
def get_auth(self): """ This method requests an authentication object from the HPE IMC NMS and returns an HTTPDigest Auth Object :return: """ url = self.h_url + self.server + ":" + self.port auth = requests.auth.HTTPDigestAuth(self.username, self.password) f_url = url + "/imcrs" try: response = requests.get(f_url, auth...
invalid. Please try again\n\n") set_imc_creds() return response.status_code except requests.exceptions.RequestException as error: return "Error:\n" + str(error) + 'The IMC server address is invalid. Please try again'
def print_title(title, is_end=False): """ Print title like ``----- {title} -----`` or ``===== {title} =====``. :param title: Title. :param is_end: Whether is end title. End title use ``=`` instead of ``-``. :return: None. """ # If is end title if is_end: # Use `=` sep = '=====' # If is not end title else: # Use `-` sep...
title if not is_end: # Print an empty line for visual comfort print_text() # Print the title, e.g. `----- {title} -----` print_text('# {sep} {title} {sep}'.format(title=title, sep=sep))
def get_full_python_version(): """ Get full Python version. E.g. - `2.7.11.final.0.32bit` - `3.5.1.final.0.64bit` :return: Full Python version. """ # Get version part, e.g. `3.5.1.final.0` version_part = '.'.join(str(x) for x in sys.version_info) # Get integer width, e.g. 32 or 64 int_width = struct.calcsize('P') * 8 #...
+ '.' + int_width_part
def get_python_path(venv_path): """ Get given virtual environment's `python` program path. :param venv_path: Virtual environment directory path. :return: `python` program path. """ # Get `bin` directory path bin_path = get_bin_path(venv_path) # Get `python` program path program_path = os.path.join(bin_path, 'python') #...
program path return program_path
def add_options(ctx): """ Add command line options. :return: None. """ # Add option ctx.add_option( '--always', action='store_true', default=False, dest='always', help='whether always run tasks.', ) # Add option ctx.add_option( '--check-import', action='store_true', default=False, dest='check_import', help='whether imp...
# Convert to int so that the value can be used as boolean type=int, metavar='0|1', help=( 'whether add full Python version to virtual environment directory' ' name. E.g. `.py3.5.1.final.0.64bit`. Default is add.' ), ) # Add option ctx.add_option( '--req', default=None, dest='req_path', help='requirements file relative ...
def add_pythonpath(path): """ Prepend given path to environment variable PYTHONPATH. :param path: Path to add to PYTHONPATH. :return: New PYTHONPATH value. """ # Get PYTHONPATH value. Default is empty string. pythonpath = os.environ.setdefault('PYTHONPATH', '') # If given path is not in PYTHONPATH if path not in python...
pythonpath else path # Return new PYTHONPATH value return pythonpath
def mark_path(path): """ Wrap given path as relative path relative to top directory. Wrapper object will be handled specially in \ :paramref:`create_cmd_task.parts`. :param path: Relative path relative to top directory. :return: Wrapper object. """ # If given path is not string, # or given path is absolute path. if not...
is not relative path: {0}.'.format( path ) # Raise error raise ValueError(msg) # If given path is string, # and given path is not absolute path. # Wrap given path return _ItemWrapper(type='path', item=path)
def _mark_target(type, item): """ Wrap given item as input or output target that should be added to task. Wrapper object will be handled specially in \ :paramref:`create_cmd_task.parts`. :param type: Target type. Allowed values: - 'input' - 'output' :param item: Item to mark as input or output target. Allowed values: -...
Wrapper object. """ # If given type is not valid if type not in ('input', 'output'): # Get error message msg = 'Error (7D74X): Type is not valid: {0}'.format(type) # Raise error raise ValueError(msg) # If given type is valid. # Store given item orig_item = item # If given path is list if isinstance(item, list): # Use i...
item # If given path is not list else: # Create items list containing given path item_s = [item] # For the items list's each item for item in item_s: # If the item is string, # and the item is absolute path. if isinstance(item, str) and os.path.isabs(item): # Get error message msg = ( 'Error (5VWOZ): Given path is not ...
).format(item) # Raise error raise ValueError(msg) # Wrap given item return _ItemWrapper(type=type, item=orig_item)
def create_node(ctx, path): """ Create node for given relative path. :param ctx: BuildContext object. :param path: Relative path relative to top directory. :return: Created Node. """ # Ensure given context object is BuildContext object _ensure_build_context(ctx) # Get top directory's relative path relative to `wscript`...
relative path to be relative to `wscript` directory node_path = os.path.join(top_dir_relpath, path) # Create node using the relative path relative to `wscript` directory node = ctx.path.make_node(node_path) # Return the created node return node
def _normalize_items( ctx, items, str_to_node=False, node_to_str=False, allow_task=False, ): """ Normalize given items. Do several things: - Ignore None. - Flatten list. - Unwrap wrapped item in `_ItemWrapper`. :param ctx: BuildContext object. :param items: Items list to normalize. :param str_to_node: Convert string to...
( normalized_item, # Normalized item. wrapper_type, # Original `_ItemWrapper` type. ) """ # Ensure given context object is BuildContext object _ensure_build_context(ctx) # Normalized tuples list norm_tuple_s = [] # If given items list is empty if not items: # Return empty list return norm_tuple_s # If given items list ...
If the item is item wrapper if isinstance(item, _ItemWrapper): # Get wrapper type wrapper_type = item.type() # Get real item item = item.item() # If the item is not item wrapper else: # Set wrapper type be None wrapper_type = None # Use the item as real item item = item # If the real item is list if isinstance(item, li...
real item as real items list real_item_s = item # If the real item is not list else: # Create real items list containing the real item real_item_s = [item] # For each real item for real_item in real_item_s: # If the real item is None if real_item is None: # Ignore None continue # If the real item is not None. # If
the real item is string elif isinstance(real_item, str): # If need convert string to node if (wrapper_type is not None) or str_to_node: # If the path string is absolute path if os.path.isabs(real_item): # Get error message msg = ( 'Error (7MWU9): Given path is not relative path:' ' {0}.' ).format(real_item) # Raise err...
# Create node as normalized item norm_item = create_node(ctx, real_item) # If need convert node to absolute path if node_to_str: # Convert the node to absolute path norm_item = norm_item.abspath() # If not need convert string to node else: # Use the string as normalized item norm_item = real_item # Create normalized tu...
string. # If the real item is node elif isinstance(real_item, Node): # If need convert node to absolute path if node_to_str: # Convert the node to absolute path real_item = real_item.abspath() # Create normalized tuple norm_tuple = (real_item, wrapper_type) # If the real item is not node. # If the real item is task eli...
# Create normalized tuple norm_tuple = (real_item, wrapper_type) # If not allow task item else: # Get error message msg = 'Error (6PVMG): Item type is not valid: {0}.'.format( real_item ) # Raise error raise ValueError(msg) # If the real item is not task. # If the real item is not None, string, node, or task else: # Ge...
(63KUG): Item type is not valid: {0}.'.format( real_item ) # Raise error raise ValueError(msg) # Add the normalized tuple to list norm_tuple_s.append(norm_tuple) # Return the normalized tuples list return norm_tuple_s
def update_touch_file( ctx, path, check_import=False, check_import_module=None, check_import_python=None, always=False, ): """ Update touch file at given path. Do two things: - Create touch file if it not exists. - Update touch file if import checking fails. The returned touch file node is used as task's output target ...
file relative path relative to top directory. :param check_import: Whether import module for dirty checking. :param check_import_module: Module name to import for dirty checking. :param check_import_python: Python program to use for dirty checking. :param always: Whether always run. :return: A two-item tuple. Tuple for...
object is BuildContext object _ensure_build_context(ctx) # Print title print_title('Update touch file: {}'.format(path)) # Create touch node touch_node = create_node(ctx, path) # Whether task needs run need_run = False # If the touch file not exists, # or `always` flag is on. if not touch_node.exists() or always: # Set...
is off. else: # If need import module for dirty checking, # and module name to import is given. if check_import and check_import_module: # Get import statement. # Notice `from` import ensures the imported module is not imported # as `__main__` module. And `__name__` exists in any module. import_stmt = 'from {} import _...
to check import is not given if check_import_python is None: # Get error message msg = ( 'Error (3BKFW): Python program to check import is not' ' given.' ) # Raise error raise ValueError(msg) # If Python program to check import is given. # Normalize given Python program path check_import_python, _ = _normalize_items( c...
If the Python program path is not string if not isinstance(check_import_python, str): # Get error message msg = ( 'Error (39FQE): Given Python program to check import is' ' not string or node: {0}.' ).format(check_import_python) # Raise error raise ValueError(msg) # If the Python program path is string. # If the Python...
Python program path to absolute path check_import_python = \ create_node(ctx, check_import_python).abspath() # The Python program path is absolute path now. # Get command parts cmd_part_s = [ # Python program absolute path check_import_python, # Run code '-c', # Code to run import_stmt ] # Print the command in multi-li...
it means the module can be imported. # Set `need_run` flag off. need_run = False # If have error, # it means the module can not be imported. # # Notice the program may not exist. So catch general exception. except Exception: # pylint: disable=W0703 # Set `need_run` flag on need_run = True # If task needs run if need_ru...
file's parent directory not exists if not touch_node.parent.exists(): # Create the touch file's parent directory touch_node.parent.mkdir() # Write current time to the touch file to force content change. # This will fail dirty-checking and cause task to run. touch_node.write('{0}\n'.format(datetime.utcnow())) # Print in...
Return a two-item tuple return touch_node, need_run
def chain_tasks(tasks): """ Chain given tasks. Set each task to run after its previous task. :param tasks: Tasks list. :return: Given tasks list. """ # If given tasks list is not empty if tasks: # Previous task previous_task = None # For given tasks list's each task for task in tasks: # If the task is not None. # Task ...
allow code like ``task if _PY2 else None``. if task is not None: # If previous task is not None if previous_task is not None: # Set the task to run after the previous task task.set_run_after(previous_task) # Set the task as previous task for the next task previous_task = task # Return given tasks list. return tasks
def create_cmd_task( ctx, parts, inputs=None, outputs=None, env=None, cwd=None, task_name=None, cache_key=None, always=False, add_to_group=True, ): """ Create task that runs given command. :param ctx: BuildContext object. :param parts: Command parts list. Each part can be: - **None**: Will be ignored. - **String**: Wil...
these**: Will be unwrapped. Item marked as input or output target will be added to created task. :param inputs: Input items list to add to created task. Each item can be: - **None**: Will be ignored. - **Path**: Relative path relative to top directory. Will be converted to node. - **Node object**: Will be used as-is. -...
run after the task. - **List of these**: Will be flattened. - **Item wrapper of these**: Will be unwrapped. :param outputs: Outputs items list to add to created task. Each item can be: - **None**: Will be ignored. - **Path**: Relative path relative to top directory. Will be converted to node. - **Node object**: Will be...
task to run after created task. - **List of these**: Will be flattened. - **Item wrapper of these**: Will be unwrapped. :param env: Environment dict. Default is use given context object's environment dict. :param cwd: Working directory in which to run given command. Default is top directory. :param task_name: Task name...
cache key. :param always: Whether mark created task as always run. :param add_to_group: Whether add created task to given context. :return: Created task. :notes: It is recommended to refer to files inside project using relative paths. This is even required if the files are used as task's input or output targets. It is ...
or relative to `wscript` file, because neither of the two choices guarantee a fixed start directory. It is not ideal to let `Waf` resolve relative paths neither, because the start directory used for resolving relative paths varies with different types of command context (i.e. OptionsContext, ConfigurationContext, Build...
first use `Waf`'s pre-defined path variable `top` to locate project's top directory (Notice path variable `top`'s value is relative to `wscript` file.). Then `aoikwafutil`'s functions like `create_cmd_task` will use path variable `top`'s value to resolve other relative paths. `create_cmd_task` handles relative paths us...
argument `parts` are used as-is. They are relative to the working directory in which to run the command. However, they can be marked to be relative to top directory instead. - Relative paths passed to argument `inputs` or `outputs` are relative to top directory. They need not be marked. """ # Ensure given context objec...
not given if not task_name: # Get the caller function's name task_name = inspect.stack()[1][3] # Print title print_title('Create task: {}'.format(task_name)) # If cache key is given if cache_key: # Find cached task cached_task = _TASKS_CACHE.get(cache_key, None) # If have found cached task if cached_task is not None: #...
the cached task return cached_task # If have not found cached task. # Continue to create task. # If cache key is not given. # Continue to create task. # Normalized command parts list norm_part_s = [] # Input nodes list input_node_s = [] # Output nodes list output_node_s = [] # Get the first command part that is program...
# If the first command part is list. # Notice the first command part can be list if the value is from `ctx.env`, # e.g `ctx.env.PYTHON`. if isinstance(first_part, list): # Use the first item in the list as the first command part parts[0] = first_part[0] # For given command parts list's each command part for part, wrapp...
part is string if isinstance(part, str): # Add the string to the normalized list norm_part_s.append(part) # If the command part is node elif isinstance(part, Node): # Add the node's absolute path to the normalized list norm_part_s.append(part.abspath()) # If the wrapper type is `input` if wrapper_type == 'input': # Add...
elif wrapper_type == 'output': # Add the node to the output nodes list output_node_s.append(part) # If the wrapper type is not `input` or `output` else: # Do nothing pass # If the command part is not string or node else: # Get error message msg = 'Error (2W9YD): Command part is not valid: {0}.'.format(part) # Raise err...
not given if env is None: # Use given context object's environment dict env = ctx.env # If working directory path is not given if cwd is None: # Set working directory path be top directory absolute path cwd = ctx.top_dir # If the working directory path is not absolute path. if not os.path.isabs(cwd): # Convert the work...
= create_node(ctx, cwd).abspath() # Create task that runs command task = CmdTask( # Context object ctx=ctx, # Command parts list parts=norm_part_s, # Environment dict env=env, # Working directory cwd=cwd, # Task name task_name=task_name, ) # For each input or output item. # Notice the code structure for handling input ...
to avoid duplicate # code. for wrapper_type, item_s, node_s, nodes_set_func in [ ('input', inputs, input_node_s, task.set_inputs), ('output', outputs, output_node_s, task.set_outputs), ]: # For each normalized item for item, _ in _normalize_items( # Context ctx=ctx, # Items to normalize items=item_s, # Convert string t...
to the nodes list node_s.append(item) # If the item is task elif isinstance(item, Task): # If the wrapper type is `input` if wrapper_type == 'input': # Set the created task to run after the task task.set_run_after(item) # If the wrapper type is `output` elif wrapper_type == 'output': # Set the task to run after the cre...
not `input` or `output` else: # Get error message msg = ( 'Error (3ZLGJ): Wrapper type is not valid: {0}.' ).format(wrapper_type) # Raise error raise ValueError(msg) # If the item is not node or task else: # Get error message msg = 'Error (5H4GC): Item type is not valid: {0}.'.format( item ) # Raise error raise ValueEr...
task as input or output targets nodes_set_func(node_s) # If need mark the created task as always run if always: # Mark the created task as always run task.always_run = True # pylint: disable=W0201 # If need add the created task to given context if add_to_group: # Add the created task to given context ctx.add_to_group(t...
the created task to the cache _TASKS_CACHE[cache_key] = task # Print end title print_title('Create task: {}'.format(task_name), is_end=True) # Return the task return task
def build_ctx(pythonpath=None): """ Decorator that makes decorated function use BuildContext instead of \ Context instance. BuildContext instance has more methods. :param pythonpath: Path or list of paths to add to environment variable PYTHONPATH. Each path can be absolute path, or relative path relative to top directo...
If decorator arguments are given, return no-argument decorator. - If decorator arguments are not given, return wrapper function. """ # If argument `pythonpath` is string if isinstance(pythonpath, str): # Create paths list containing the string path_s = [pythonpath] # If argument `pythonpath` is list elif isinstance(pyt...
or list, # it means the decorator is used without arguments. else: # Set paths list be None path_s = None # Create no-argument decorator def _noarg_decorator(func): """ No-argument decorator. :param func: Decorated function. :return: Wrapper function. """ # Create BuildContext subclass class _BuildContext(BuildContext)...
= func.__name__ # Create wrapper function @wraps(func) def _new_func(ctx, *args, **kwargs): """ Wrapper function. :param ctx: BuildContext object. :param \\*args: Other arguments passed to decorated function. :param \\*\\*kwargs: Other keyword arguments passed to decorated function. :return: Decorated function's call r...
path if os.path.isabs(path): # Use the path as absolute path abs_path = path # If the path is not absolute path, # it means relative path relative to top directory. else: # Create path node path_node = create_node(ctx, path) # Get absolute path abs_path = path_node.abspath() # Add the absolute path to environment varia...
*args, **kwargs) # Return the call result return result # Store the created context class with the wrapper function _new_func._context_class = _BuildContext # pylint: disable=W0212 # Return the wrapper function return _new_func # If decorator arguments are given if path_s is not None: # Return no-argument decorator ret...
_func = pythonpath # Call the no-argument decorator to create wrapper function wrapper_func = _noarg_decorator(_func) # Return the wrapper function return wrapper_func
def config_ctx(func): """ Decorator that makes decorated function use ConfigurationContext instead \ of Context instance. :param func: Decorated function. :return: Decorated function. """ # Create ConfigurationContext subclass class _ConfigurationContext(ConfigurationContext): # Set command name for the context class c...
# pylint: disable=W0212 # Return the decorated function return func
def print_ctx(ctx): """ Print given context's info. :param ctx: Context object. :return: None. """ # Print title print_title('ctx attributes') # Print context object's attributes print_text(dir(ctx)) # Print end title print_title('ctx attributes', is_end=True) # Print title print_title('ctx.options') # Print context op...
has `env` attribute. if hasattr(ctx, 'env'): # Print title print_title('ctx.env') # Print context environment variables dict print_text(pformat(dict(ctx.env), indent=4, width=1)) # Print end title print_title('ctx.env', is_end=True)
def virtualenv_setup( ctx, python, inputs=None, outputs=None, touch=None, check_import=False, pip_setup_file=None, pip_setup_touch=None, cache_key=None, always=False, ): """ Create task that sets up `virtualenv` package. :param ctx: BuildContext object. :param python: Python program path. :param inputs: Input items lis...
Touch file path for dirty checking. :param check_import: Whether import module for dirty checking. :param pip_setup_file: `get-pip.py` file path for `pip_setup` task. :param pip_setup_touch: Touch file path for `pip_setup` task. :param cache_key: Task cache key. :param always: Whether always run. :return: Created task....
None: # Not create task that sets up `pip` pip_setup_task = None # If `get-pip.py` file path is given else: # Create task that sets up `pip` pip_setup_task = pip_setup( # Context ctx=ctx, # Python program path python=python, # `get-pip.py` file path setup_file=pip_setup_file, # Touch file path touch=pip_setup_touch, # ...
touch file path is not given if touch is None: # Not update touch file touch_node = None else: # Update touch file touch_node, always = update_touch_file( # Context ctx=ctx, # Touch file path path=touch, # Whether import module for dirty checking check_import=check_import, # Module name to import for dirty checking che...
always=always, ) # Create task that sets up `virtualenv` package task = create_cmd_task( # Context ctx=ctx, # Command parts parts=[ # Python program path python, # Run module '-m', # Module name 'pip', # Install package 'install', # Package name 'virtualenv', ], # Input items list inputs=[ # Run after the task that set...