-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from debrief/combine
Combine
- Loading branch information
Showing
14 changed files
with
257 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from ..support.color_picker import hex_color_for, mean_color_for, color_for | ||
|
||
|
||
def export(filename, chars, dict_colors): | ||
""" | ||
To outsource method from high class and make it more readable | ||
:param filename: Name of f_out | ||
:param chars: pointer of char array | ||
:param dict_colors: pointer of dict colors | ||
:return: | ||
""" | ||
|
||
f_out = open(filename, "w") | ||
|
||
last_hash = "" | ||
|
||
for char_index in chars: | ||
letter = char_index.letter | ||
this_hash = "" | ||
this_message = "" | ||
colors = [] | ||
for usage in char_index.usages: | ||
this_hash += usage.tool_field | ||
needs_new_line = this_message != "" | ||
colors.append(color_for(usage.tool_field, dict_colors)) | ||
if needs_new_line: | ||
this_message += " // " | ||
this_message += usage.tool_field + ", " + usage.message | ||
|
||
# do we have anything to shade? | ||
if this_hash != "": | ||
# generate/retrieve a color for this hash | ||
new_color = mean_color_for(colors) | ||
hex_color = hex_color_for(new_color) | ||
|
||
# are we already in hash? | ||
if last_hash != "": | ||
# is it the different to this one? | ||
if last_hash != this_hash: | ||
# ok, close the span | ||
f_out.write("</span>") | ||
|
||
# start a new span | ||
f_out.write("<span title='" + this_message + "' style=\"background-color:" + hex_color + "\"a>") | ||
else: | ||
f_out.write("<span title='" + this_message + "' style=\"background-color:" + hex_color + "\">") | ||
elif last_hash != "": | ||
f_out.write("</span>") | ||
|
||
# just check if it's newline | ||
if letter == "\n": | ||
f_out.write("<br>") | ||
else: | ||
f_out.write(letter) | ||
|
||
last_hash = this_hash | ||
|
||
if last_hash != "": | ||
f_out.write("</span>") | ||
|
||
f_out.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
951212 050000.000 MONDEO_44 @C 269.7 10.0 10 | ||
// EVENT 951212 050300.000 BRAVO | ||
// EVENT 951212 050300.000 CHARLIE | ||
951212 050300.000 FORD_11 @C 354.7 22.1 14 | ||
951212 050200.000 COROLLA_44 @C 177.9 36.1 15 | ||
// EVENT 951212 050300.000 DELTA | ||
951212 050300.000 COROLLA_44 @C 200 60.1 15 | ||
// EVENT 951212 050300.000 BRAVO | ||
// EVENT 951212 050300.000 CHARLIE | ||
951212 050300.000 FORD_11 @C 354.7 22.1 14 | ||
951212 050200.000 COROLLA_44 @C 177.9 36.1 15 | ||
// EVENT 951212 050300.000 DELTA | ||
951212 050300.000 COROLLA_44 @C 200 60.1 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
951212, 050000.000, MONDEO_44, @C, 269.7, 2.0, 10 | ||
//, EVENT, 951212, 050300.000, BRAVO | ||
//, EVENT, 951212, 050300.000, CHARLIE | ||
951212, 050300.000, FORD_11, @C, 354.7, 2.1, 14 | ||
951212, 050200.000, COROLLA_44, @C, 177.9, 3.1, 15 | ||
//, EVENT, 951212, 050300.000, DELTA | ||
951212, 050300.000, COROLLA_44, @C, 200, 3.1, 15 | ||
//, EVENT, 951212, 050300.000, BRAVO | ||
//, EVENT, 951212, 050300.000, CHARLIE | ||
951212, 050300.000, FORD_11, @C, 354.7, 2.1, 14 | ||
951212, 050200.000, COROLLA_44, @C, 177.9, 3.1, 15 | ||
//, EVENT, 951212, 050300.000, DELTA | ||
951212, 050300.000, COROLLA_44, @C, 200, 3.1, 15 |
Oops, something went wrong.