Skip to content
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

Add an app category in Cozy #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions cosy.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def parse_elffile(elffile, prefix, appdir, riot_base=None):
r"(?P<type>[tbdTDB]) "
r"(?P<sym>[0-9a-zA-Z_$.]+)\s+"
r"(.*/)?"
r"("
r"(?P<dir>"
r"{appdir}|"
r"{riot_base}|"
r".cargo/registry/src/[^/]+|"
Expand All @@ -171,7 +171,7 @@ def parse_elffile(elffile, prefix, appdir, riot_base=None):
r"ip-over-ble_experiments|" # HACK...
r"{appdir}/.*bin/pkg"
r")/"
r"(?P<path>.+)/"
r"((?P<path>.+)/)?"
r"(?P<file>[0-9a-zA-Z_-]+\.(c|h|rs)):"
r"(?P<line>\d+)$".format(riot_base=riot_base,
appdir=appdir))
Expand All @@ -180,7 +180,16 @@ def parse_elffile(elffile, prefix, appdir, riot_base=None):
if m:
d = {'arcv': '', 'obj': '', 'size': -1, 'alias': []}
d.update(m.groupdict())
if d['path'] is None:
d['path'] = ""
Comment on lines +183 to +184

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this check? Shouldn't d['path'] be an array of strings as you use it below?

d['path'] = d['path'].split(path.sep)
if d['dir'] == appdir:
if d['path'][0] == "":
d['path'][0] = "app"
else:
d['path'].insert(0, "app")
if d['path'][0] == "examples":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this indeed rebrands applications residing in-tree in the examples folder, it does not work for applications in the tests directory, for example. Also, with RIOT-OS/RIOT#21135 in, the complete path might look strange when just examples is replaced with app, but the subdirectories stay the same.

From a high-level perspective, I would expect that if we have the appdir given as a string, we could grep for it and replace it straight away with the single path app?

d['path'][0] = "app"
d['line'] = int(d['line'])
d['addr'] = int(d['addr'], 16)
d['type'] = d['type'].lower()
Expand Down
1 change: 1 addition & 0 deletions root/sunburst.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var b = {

// Mapping of step names to colors.
var colors = {
"app": "#d98b8f",
"core": "#a173d1",
"cpu": "#7b615c",
"boards": "#de783b",
Expand Down