Skip to content

Commit

Permalink
fixed issues detected by tox
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTimperley committed Jun 9, 2020
1 parent 128d100 commit 43f9a83
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/kaskara/spoon/analyser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
__all__ = ('SpoonAnalyser',)

from typing import Any, Iterator, Mapping, Sequence
from typing import Any, Iterator, List, Mapping, Sequence
import contextlib
import json
import os
Expand Down Expand Up @@ -116,7 +116,7 @@ def _load_functions_from_dict(self,

def _load_loops_from_dict(self,
dict_: Sequence[Mapping[str, Any]]
) -> ProgramFunctions:
) -> ProgramLoops:
"""Loads the loops database from a given dictionary."""
logger.debug('parsing loop database')
loop_bodies: List[FileLocationRange] = []
Expand Down
23 changes: 12 additions & 11 deletions lib/kaskara/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,25 @@ def abs_to_rel_filename(prefix: str, filename: str) -> str:
return filename[len(prefix):]


def abs_to_rel_floc(prefix: str, l: FileLocation) -> FileLocation:
return FileLocation(abs_to_rel_filename(prefix, l.filename),
l.location)
def abs_to_rel_floc(prefix: str, location: FileLocation) -> FileLocation:
return FileLocation(abs_to_rel_filename(prefix, location.filename),
location.location)


def rel_to_abs_floc(prefix: str, l: FileLocation) -> FileLocation:
return FileLocation(os.path.join(prefix, l.filename), l.location)
def rel_to_abs_floc(prefix: str, location: FileLocation) -> FileLocation:
return FileLocation(os.path.join(prefix, location.filename),
location.location)


def abs_to_rel_flocrange(prefix: str,
l: FileLocationRange
location: FileLocationRange
) -> FileLocationRange:
return FileLocationRange(abs_to_rel_filename(prefix, l.filename),
l.location_range)
return FileLocationRange(abs_to_rel_filename(prefix, location.filename),
location.location_range)


def rel_to_abs_flocrange(prefix: str,
l: FileLocationRange
location: FileLocationRange
) -> FileLocationRange:
return FileLocationRange(os.path.join(prefix, l.filename),
l.location_range)
return FileLocationRange(os.path.join(prefix, location.filename),
location.location_range)

0 comments on commit 43f9a83

Please sign in to comment.