How to use the haros.metamodel.Location function in haros

To help you get started, we’ve selected a few haros examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github git-afsantos / haros / haros / extractor.py View on Github external
def _call_location(self, call):
        try:
            source_file = next(
                sf
                for sf in self.package.source_files
                if sf.path == call.file)
        except StopIteration:
            souce_file = None

        function = call.function
        if function:
            function = function.name
        return Location(self.package, file=source_file, line=call.line,
                        fun=function)
github git-afsantos / haros / haros / extractor.py View on Github external
def _call_location(self, call):
        try:
            source_file = next(
                sf
                for sf in self.package.source_files
                if sf.path == call.file)
        except StopIteration:
            souce_file = None

        function = call.function
        if function:
            function = function.name
        return Location(self.package, file=source_file, line=call.line,
                        fun=function)
github git-afsantos / haros / haros / extractor.py View on Github external
def _location_from_JSON(self, datum):
        try:
            pkg = self._get_package(datum["package"])
            sf = None
            filename = datum["file"]
            if filename:
                sf = self._get_files(pkg, [filename])[0]
        except ValueError:
            return None
        return Location(pkg, file = sf, line = datum["line"],
                        fun = datum["function"], cls = datum["class"])
github git-afsantos / haros / haros / metamodel.py View on Github external
def location(self):
        return Location(self.package)
github git-afsantos / haros / haros / metamodel.py View on Github external
def location(self):
        return Location(self.package, file=self)
github git-afsantos / haros / haros / metamodel.py View on Github external
def location(self):
        return Location(self)