Processed filename getter.

@param \CsvMigrations\Model\Entity\Import $import Import entity
@param bool $fullBase Full base flag
@return string
482066
public static function getProcessedFile(ImportEntity $import, bool $fullBase = true) : string
    {
        $pathInfo = pathinfo($import->get('filename'));
        $extension = $pathInfo['extension'] ?? '';
        if (!empty($extension)) {
            $extension = '.' . $extension;
        }

        $result = $pathInfo['filename'] . static::PROCESSED_FILE_SUFFIX . $extension;
        if (!$fullBase) {
            return $result;
        }

        $result = $pathInfo['dirname'] . DS . $result;

        return $result;
    }
593653
def source_statement(self):
        """"""
        if self._has_alias():
            return 'import %s as %s' % (self.fullName, self.name)
        else:
            return 'import %s' % self.fullName
367301
def _get_callable_full_name(self, fob, fin, uobj):
        """"""
        # Check if object is a class property
        name = self._property_search(fob)
        if name:
            del fob, fin, uobj
            return name
        if os.path.isfile(fin):
            lineno = fob.f_lineno
            ret = self._callables_obj.get_callable_from_line(fin, lineno)
            del fob, fin, uobj, name, lineno
            return ret
        # Code executed in doctests does not have an actual callable object
        # exec-based callables do not have a valid file name
        fname = uobj and _get_func_code(uobj).co_filename
        if (not fname) or (fname and (not os.path.isfile(fname))):
            del fob, fin, uobj, name, fname
            return "dynamic"
        code_id = (
            inspect.getfile(uobj).replace(".pyc", "py"),
            inspect.getsourcelines(uobj)[1],
        )
        self._callables_obj.trace([code_id[0]])
        ret = self._callables_obj.reverse_callables_db[code_id]
        del fob, fin, uobj, name, fname, code_id
        return ret
915981
def get_imports(fname):
    
    txt = ''
    with open(fname, 'r') as f:
        for line in f:
            if line[0:6] == 'import':
                txt += '<PRE>' + strip_text_after_string(line[7:], ' as ') + '</PRE>\n'
    return txt + '<BR>'
872372
public function count(Import $import)
	{
		// create iterator
		$iterator = new Reader($import->getDatapath(), $this->key);

		// return count
		return $iterator->total();
	}
363807
private Class<?> getImportedClassImpl(final String name) throws UtilEvalError {
        // Try explicitly imported class, e.g. import foo.Bar;
        String fullname = this.importedClasses.get(name);
        // not sure if we should really recurse here for explicitly imported
        // class in parent...
        if (fullname != null) {
            /* Found the full name in imported classes. */
            // Try to make the full imported name
            Class<?> clas = this.classForName(fullname);

            if ( clas != null )
                return clas;

            // Handle imported inner class case
            // Imported full name wasn't found as an absolute class
            // If it is compound, try to resolve to an inner class.
            // (maybe this should happen in the BshClassManager?)
            if (Name.isCompound(fullname))
                try {
                    clas = this.getNameResolver(fullname).toClass();
                } catch (final ClassNotFoundException e) { /* not a class */ }
            Interpreter.debug(
                        "imported unpackaged name not found:", fullname);
            // If found cache the full name in the BshClassManager
            if (clas != null) {
                // (should we cache info in not a class case too?)
                this.getClassManager().cacheClassInfo(fullname, clas);
                return clas;
            }
            // It was explicitly imported, but we don't know what it is.
            // should we throw an error here??
            return null;
        }
        /* Try imported packages, e.g. "import foo.bar.*;" in reverse order of
         * import... (give later imports precedence...) */
        for (final String s: this.importedPackages) {
            final Class<?> c = this.classForName(s + "." + name);
            if (c != null)
                return c;
        }
        final BshClassManager bcm = this.getClassManager();
        /* Try super import if available Note: we do this last to allow
         * explicitly imported classes and packages to take priority. This
         * method will also throw an error indicating ambiguity if it
         * exists... */
        if (bcm.hasSuperImport()) {
            final String s = bcm.getClassNameByUnqName(name);
            if (s != null)
                return this.classForName(s);
        }
        return null;
    }
205002
public function importBundleTranslationFiles(ImportCommand $importCommand)
    {
        $importBundle = strtolower($importCommand->getDefaultBundle());

        if ($importBundle == 'all') {
            $importCount = $this->importAllBundlesTranslationFiles($importCommand);

            if (Kernel::VERSION_ID >= 40000) {
                $importCount += $this->importSf4TranslationFiles($importCommand);
            }

            return $importCount;
        } elseif ($importBundle == 'custom') {
            return $this->importCustomBundlesTranslationFiles($importCommand);
        } else {
            if (Kernel::VERSION_ID >= 40000) {
                return $this->importSf4TranslationFiles($importCommand);
            }

            return $this->importOwnBundlesTranslationFiles($importCommand);
        }
    }
973613
public function getEntry($full = true)
    {
        $key = $full ? 'scriptFilename' : 'scriptName';

        $wDir = $this->get('workDir');
        $file = $this->get($key);

        if (strpos($file, $wDir) === 0) {
            $file = substr($file, \strlen($wDir));
        }

        $file = rtrim($file, '.' . DIRECTORY_SEPARATOR);

        if ($full && $this->get('isCli')) {
            $file = $wDir . DIRECTORY_SEPARATOR . $file;
        }

        return $file;
    }
883226
protected function _getExportFileName()
    {
        $sSessionFileName = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sExportFileName");
        if (!$sSessionFileName) {
            $sSessionFileName = md5($this->getSession()->getId() . \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId());
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportFileName", $sSessionFileName);
        }

        return $sSessionFileName;
    }
691715
public function getFullPath(string $migration): string
    {
        return implode('/', array_merge(
            [$this->getBasePath()],
            array_filter(
                [$this->getMajorVersion(), $this->getMinorVersion(), $this->getPatch()],
                function (string $value) : bool {
                    return $value === '0' || (bool)$value;
                }
            ),
            [$migration]
        ));
    }
768839
def _get_module_via_pkgutil(self, fullname):
        
        try:
            # Pre-'import spec' this returned None, in Python3.6 it raises
            # ImportError.
            loader = pkgutil.find_loader(fullname)
        except ImportError:
            e = sys.exc_info()[1]
            LOG.debug('%r._get_module_via_pkgutil(%r): %s',
                      self, fullname, e)
            return None

        IOLOG.debug('%r._get_module_via_pkgutil(%r) -> %r',
                    self, fullname, loader)
        if not loader:
            return

        try:
            path = self._py_filename(loader.get_filename(fullname))
            source = loader.get_source(fullname)
            is_pkg = loader.is_package(fullname)
        except (AttributeError, ImportError):
            # - Per PEP-302, get_source() and is_package() are optional,
            #   calling them may throw AttributeError.
            # - get_filename() may throw ImportError if pkgutil.find_loader()
            #   picks a "parent" package's loader for some crap that's been
            #   stuffed in sys.modules, for example in the case of urllib3:
            #       "loader for urllib3.contrib.pyopenssl cannot handle
            #        requests.packages.urllib3.contrib.pyopenssl"
            e = sys.exc_info()[1]
            LOG.debug('%r: loading %r using %r failed: %s',
                      self, fullname, loader, e)
            return

        if path is None or source is None:
            return

        if isinstance(source, mitogen.core.UnicodeType):
            # get_source() returns "string" according to PEP-302, which was
            # reinterpreted for Python 3 to mean a Unicode string.
            source = source.encode('utf-8')

        return path, source, is_pkg
1219169
def qualified_name_import(cls):
    

    parts = qualified_name(cls).split('.')

    return "from {} import {}".format('.'.join(parts[:-1]), parts[-1])
1337388
public function getEntry($full = true)
    {
        $key = $full ? 'SCRIPT_FILENAME' : 'SCRIPT_NAME';

        $wdir = $this->getWorkingDirectory();

        $file = $this->getServerParam($key);

        if (strpos($file, $wdir) === 0) {
            $file = substr($file, strlen($wdir));
        }

        $file = trim($file, '.' . DIRECTORY_SEPARATOR);

        if ($full && $this->isCli()) {
            $file = $wdir . DIRECTORY_SEPARATOR . $file;
        }

        return $file;
    }
1161204
private function import($filename, $update = false): int
    {
        list($parseError, , , $results) = Architect::$plugin->architectService->import(file_get_contents($filename), false, $update);

        if ($parseError) {
            $this->stdout('JSON: ', Console::FG_RED);
            $this->stdout($results[0] . PHP_EOL);
            $this->stdout('YAML: ', Console::FG_RED);
            $this->stdout($results[1] . PHP_EOL);

            return ExitCode::DATAERR;
        }

        foreach ($results as $value) {
            foreach ($value as $item) {
                if ($item['success'] === true) {
                    $this->stdout("Success: \n", Console::FG_GREEN);
                    $this->stdout('- ' . get_class($item['item']) . ' ' . $item['item']['name'] . PHP_EOL);
                } else {
                    $this->stdout("Error: \n", Console::FG_RED);
                    foreach ($item['errors'] as $err) {
                        $this->stdout('- ' . $err[0] . PHP_EOL);
                    }
                }
            }
        }

        return ExitCode::OK;
    }
353307
function getBasename($includeExtensions = true)
    {
        $basename = basename($this->path);

        if (!$includeExtensions) {
            $basename = substr($basename, 0, strpos($basename, '.'));
        }

        return $basename;
    }
1283926
def find_imports(filename):
    
    with open(filename) as f:
        root = ast.parse(f.read(), filename)
    visitor = ImportFinder(filename)
    visitor.visit(root)
    return visitor.imports
88272
function bootstrapLessFilenames() {
    var IMPORT_REGEX = /^@import \"(.*?)\";$/
    var bootstrapLessLines = __less['bootstrap.less'].split('\n')

    for (var i = 0, imports = []; i < bootstrapLessLines.length; i++) {
      var match = IMPORT_REGEX.exec(bootstrapLessLines[i])
      if (match) imports.push(match[1])
    }

    return imports
  }