text
stringlengths
0
828
ctx.gbc.say('curr dict', stuff=ditem, verbosity=101)
flitem = flat(ctx, ditem)
ctx.gbc.say('curr flat dict', stuff=flitem, verbosity=101)
row_ok = True
for wp in wheres:
# TODO: negative selects: k:None, k:False,k:Zero,k:Null,k:0,k:-1,k:'',k:"""",
# TODO: negative selects: k:BUBBLE_NO_KEY,k:BUBBLE_NO_VAL
if not wp['val'] in str(flitem[wp['key']]):
row_ok = False
if not row_ok:
continue
for sel in aliases:
if sel['key'] in flitem:
row.append(flitem[sel['key']])
else:
# temporary to check, not use case for buts()
bnp = '____BTS_NO_PATH_'
tempv = get_flat_path(ctx, flitem, sel['key'] + '.*', bnp)
if tempv != bnp:
row.append(tempv)
else:
row.append('None')
# TODO maybe 'NONE', or just '' or something like:
# magic.export_format_none
data.append(row)
except Exception as excpt:
ctx.say_red('Cannot promote data', stuff=excpt)
raise click.Abort()
if order:
olast2 = order[-2:]
ctx.gbc.say('order:' + order + ' last2:' + olast2, verbosity=100)
if olast2 not in [':+', ':-']:
data = data.sort(order, False)
else:
if olast2 == ':+':
data = data.sort(order[:-2], False)
if olast2 == ':-':
data = data.sort(order[:-2], True)"
2005,"def _setup():
""""""
Sets up the global import environment variables by registering the
sub-folders for projex as import locations. When defining your
custom manager, you will want to overload this method to do any
sort of global initialization that you wish before continuing.
:warning This method is called by the _setup method, and should
not be called directly.
""""""
projex_path = os.getenv('PROJEX_PATH')
if not projex_path:
return
base_path = os.path.dirname(__file__)
logger.debug('Loading PROJEX_PATH: %s' % projex_path)
# load the defaults from the install directory
# load the paths from the environment
paths = projex_path.split(os.path.pathsep)
paths += [
os.path.join(base_path, 'userplug'),
os.path.join(base_path, 'stdplug'),
os.path.join(base_path, 'lib'),
]
sys.path = paths + sys.path"
2006,"def appendPath(self, path):
""""""
Appends the inputted path to the end of the sys.path variable,
provided the path does not already exist in it.
:param path
:type str
:return bool: success
""""""
# normalize the path
path = os.path.normcase(nstr(path)).strip()
if path and path != '.' and path not in sys.path:
sys.path.append(path)
self._addedpaths.append(path)
return True
return False"
2007,"def expandvars(self, text, environ=None, cache=None):
""""""
Recursively expands the text variables, vs. the os.path \
method which only works at one level. The cache value should be \
left blank as it is used to protect against recursion.
:param text | <str>
environ | <dict> || None
cache | <dict> { <str>: <str>, .. }
:return <str>