Print location of RASH related file.
172694
def locate_run(output, target, no_newline):
    
    from .config import ConfigStore
    cfstore = ConfigStore()
    path = getattr(cfstore, "{0}_path".format(target))
    output.write(path)
    if not no_newline:
        output.write("\n")
273294
def _file_loc(self):
        
        if self.__fname is None:
            f = os.path.splitext(os.path.basename(argv[0]))[0] + '.ini'
            cwd = os.getcwd()
            # todo: prefer script path or current path ??
            # print(os.path.realpath(sys.argv[0]))
            # todo: if os.path.exists(os.path.join(cwd, main.__file__)):
            return os.path.join(cwd, f)
        return self.__fname
350434
def _print_results(file, status):
        

        file_color = c.Fore.GREEN
        status_color = c.Fore.RED
        if status == 'Success':
            status_color = c.Fore.GREEN
        elif status == 'Skipped':
            status_color = c.Fore.YELLOW
        print(
            '{}{!s:<13}{}{!s:<35}{}{!s:<8}{}{}'.format(
                c.Fore.CYAN,
                'Downloading:',
                file_color,
                file,
                c.Fore.CYAN,
                'Status:',
                status_color,
                status,
            )
        )
539138
def rmdir(path):
    """"""
    try:
        os.rmdir(path)
    except OSError as exc:
        print(str(exc))
389712
def print_info(self, buf=sys.stdout, verbose=False):
        """"""
        _pr = Printer(buf)

        if not self.contexts:
            _pr("Suite is empty.")
            return

        context_names = sorted(self.contexts.iterkeys())
        _pr("Suite contains %d contexts:" % len(context_names))

        if not verbose:
            _pr(' '.join(context_names))
            return

        tools = self.get_tools().values()
        context_tools = defaultdict(set)
        context_variants = defaultdict(set)
        for entry in tools:
            context_name = entry["context_name"]
            context_tools[context_name].add(entry["tool_name"])
            context_variants[context_name].add(str(entry["variant"]))

        _pr()
        rows = [["NAME", "VISIBLE TOOLS", "PATH"],
                ["----", "-------------", "----"]]

        for context_name in context_names:
            context_path = self._context_path(context_name) or '-'
            ntools = len(context_tools.get(context_name, []))
            if ntools:
                nvariants = len(context_variants[context_name])
                short_desc = "%d tools from %d packages" % (ntools, nvariants)
            else:
                short_desc = "no tools"
            rows.append((context_name, short_desc, context_path))

        _pr("\n".join(columnise(rows)))
1310464
def warning(self, s):
        
        print("   WARNING: '%s', %s" % (self.src_id, s), file=sys.stderr)
77864
def printfile(aFileName):
    
    print("\nMission file: %s" % aFileName)
    with open(aFileName) as f:
        for line in f:
            print(' %s' % line.strip())
994005
def select_output_directory(self):
        """"""
        # Input layer
        input_layer_path = self.layer.source()
        input_file_name = os.path.basename(input_layer_path)
        input_extension = os.path.splitext(input_file_name)[1]

        # Get current path
        current_file_path = self.output_path_line_edit.text()
        if not current_file_path or not os.path.exists(current_file_path):
            current_file_path = input_layer_path

        # Filtering based on input layer
        extension_mapping = {
            '.shp': tr('Shapefile (*.shp);;'),
            '.geojson': tr('GeoJSON (*.geojson);;'),
            '.tif': tr('Raster TIF/TIFF (*.tif, *.tiff);;'),
            '.tiff': tr('Raster TIF/TIFF (*.tiff, *.tiff);;'),
            '.asc': tr('Raster ASCII File (*.asc);;'),
        }
        # Open File Dialog
        file_path, __ = QFileDialog.getSaveFileName(
            self,
            tr('Output File'),
            current_file_path,
            extension_mapping[input_extension]
        )
        if file_path:
            self.output_path_line_edit.setText(file_path)
78278
def get_outfile(self, outfile, goids=None):
        """"""
        # 1. Use the user-specfied output filename for the GO Term plot
        if outfile != self.dflt_outfile:
            return outfile
        # 2. If only plotting 1 GO term, use GO is in plot name
        if goids is not None and len(goids) == 1:
            goid = next(iter(goids))
            goobj = self.gosubdag.go2obj[goid]
            fout = "GO_{NN}_{NM}".format(NN=goid.replace("GO:", ""), NM=goobj.name)
            return ".".join([re.sub(r"[\s#'()+,-./:<=>\[\]_}]", '_', fout), 'png'])
        # 3. Return default name
        return self.dflt_outfile
960929
def get_css(self):
        
        css = {}

        print_css = os.path.join(self.theme_dir, 'css', 'print.css')

        if not os.path.exists(print_css):
            # Fall back to default theme
            print_css = os.path.join(THEMES_DIR, 'default', 'css', 'print.css')

            if not os.path.exists(print_css):
                raise IOError(u"Cannot find css/print.css in default theme")

        with codecs.open(print_css, encoding=self.encoding) as css_file:
            css['print'] = {
                'path_url': utils.get_path_url(print_css, self.relative),
                'contents': css_file.read(),
            }

        screen_css = os.path.join(self.theme_dir, 'css', 'screen.css')

        if (os.path.exists(screen_css)):
            with codecs.open(screen_css, encoding=self.encoding) as css_file:
                css['screen'] = {
                    'path_url': utils.get_path_url(screen_css, self.relative),
                    'contents': css_file.read(),
                }
        else:
            self.log(u"No screen stylesheet provided in current theme",
                      'warning')

        return css
1233421
def get_src_or_dst_prompt(mode):
    
    _words = {"read": "from", "write": "to"}
    # print(os.getcwd())
    prompt = "Where would you like to {} your file(s) {}?\n" \
             "1. Desktop ({})\n" \
             "2. Downloads ({})\n" \
             "3. Current ({})\n" \
             "4. Browse".format(mode, _words[mode],
                                  os.path.expanduser('~/Desktop'),
                                    os.path.expanduser('~/Downloads'),
                                    os.getcwd())
    return prompt
1172626
def _GetRelPath(self, filename):
		""""""
		assert filename.startswith(self.subdir), (filename, self.subdir)
		return filename[len(self.subdir):].lstrip(r"\/")
465227
def printdir(self):
        """"""
        print "%-46s %19s %12s" % ("File Name", "Modified    ", "Size")
        for zinfo in self.filelist:
            date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
            print "%-46s %s %12d" % (zinfo.filename, date, zinfo.file_size)
55871
function printFilePath(filePath: string): void {
  const relativeFilePath = filePath
    .replace(process.cwd(), '')
    .replace(/^\//, '')

  const underlinedText = chalk.underline(relativeFilePath)
  console.log(underlinedText)
}
327074
def print_about(self):
        """"""
        filepath = os.path.join(self.suite_path, "bin", self.tool_name)
        print "Tool:     %s" % self.tool_name
        print "Path:     %s" % filepath
        print "Suite:    %s" % self.suite_path

        msg = "%s (%r)" % (self.context.load_path, self.context_name)
        print "Context:  %s" % msg

        variants = self.context.get_tool_variants(self.tool_name)
        if variants:
            if len(variants) > 1:
                self._print_conflicting(variants)
            else:
                variant = iter(variants).next()
                print "Package:  %s" % variant.qualified_package_name
        return 0
297191
def Print(self):
        """"""
        for hypo, prob in sorted(self.Items()):
            print(hypo, prob)
333965
def file_attribs(location,
                 mode=None,
                 owner=None,
                 group=None,
                 use_sudo=False,
                 recursive=True):
    """"""
    return dir_attribs(location=location,
                       mode=mode,
                       owner=owner,
                       group=group,
                       recursive=recursive,
                       use_sudo=False)