Skip to content

Fixing import paths of memap.py when excuted as a script #7673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tools/memap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
from __future__ import print_function, division, absolute_import

from abc import abstractmethod, ABCMeta
from sys import stdout, exit, argv
from sys import stdout, exit, argv, path
from os import sep, rename, remove
from os.path import (basename, dirname, join, relpath, abspath, commonprefix,
splitext, exists)

# Be sure that the tools directory is in the search path
ROOT = abspath(join(dirname(__file__), ".."))
path.insert(0, ROOT)

import re
import csv
import json
Expand All @@ -18,9 +23,9 @@
from jinja2 import FileSystemLoader, StrictUndefined
from jinja2.environment import Environment

from .utils import (argparse_filestring_type, argparse_lowercase_hyphen_type,
argparse_uppercase_type)
from .settings import COMPARE_FIXED
from tools.utils import (argparse_filestring_type, argparse_lowercase_hyphen_type,
argparse_uppercase_type)
from tools.settings import COMPARE_FIXED


class _Parser(object):
Expand Down Expand Up @@ -93,7 +98,7 @@ class _GccParser(_Parser):
_Parser.MISC_FLASH_SECTIONS + ('unknown', 'OUTPUT')

def check_new_section(self, line):
""" Check whether a new section in a map file has been detected
""" Check whether a new section in a map file has been detected

Positional arguments:
line - the line to check for a new section
Expand Down Expand Up @@ -790,7 +795,7 @@ def compute_report(self):
self.mem_report.append({
"module": name,
"size":{
k: sizes.get(k, 0) for k in (self.print_sections +
k: sizes.get(k, 0) for k in (self.print_sections +
self.delta_sections)
}
})
Expand Down