Skip to content
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
3 changes: 0 additions & 3 deletions cmds/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ def exec(message: Message):
size = len(row) - len(row.lstrip())
spaces.append(size)

# Subtracting the min prepending space off of each line so the board shape is defined from the relative shape of the input and you can have prepending spaces.
spaces = [row - min(spaces) for row in spaces]

# Determine board type with leading whitespace
if spaces[0] < spaces[1] < spaces[2]:
board = 'stagger'
Expand Down
2 changes: 0 additions & 2 deletions cmds/setfingermap.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def board_value(rows):
size = len(row) - len(row.lstrip())
spaces.append(size)

spaces = [row - min(spaces) for row in spaces]

# Determine board type with leading whitespace
if spaces[0] < spaces[1] < spaces[2]:
return 'stagger'
Expand Down
4 changes: 3 additions & 1 deletion util/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def get_layout(message: Message) -> Tuple[str, str]:

args = tokens[0].split()
name = '-'.join(args[2:] if args[0] in TRIGGERS else args[1:]).lower()
matrix = tokens[1].strip().lower()
lines = [line for line in tokens[1].splitlines() if line.strip() != '']
min_space = min(len(line) - len(line.lstrip()) for line in lines)
matrix = '\n'.join([line[min_space:] for line in lines])

return name, matrix

Expand Down