Skip to content

Commit

Permalink
More groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Feb 5, 2024
1 parent 3362840 commit 3396245
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 28 deletions.
22 changes: 13 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -587,15 +587,6 @@ CLI Usage
file.
--s3, --styles-v3 List all possible version 3 styles.
--s4, --styles-v4 List all possible version 4 styles.
--staff-space <dimension>
Set the staff space or spatium. This is the vertical
distance between two lines of a music staff.
--page-size <width> <height>
Set the page size.
--a4, --din-a4 Set the paper size to DIN A4 (210 by 297 mm).
--letter Set the paper size to Letter (8.5 by 11 in).
--margin <dimension> Set the top, right, bottom and left margins to the same
value.
--reset-small-staffs Reset all small staffs to normal size.

font (style):
Expand All @@ -614,6 +605,19 @@ CLI Usage
--musical-text-font <font-face>
Set “musicalTextFont”.

page (style):
Page settings.

--staff-space <dimension>
Set the staff space or spatium. This is the vertical
distance between two lines of a music staff.
--page-size <width> <height>
Set the page size.
--a4, --din-a4 Set the paper size to DIN A4 (210 by 297 mm).
--letter Set the paper size to Letter (8.5 by 11 in).
--margin <dimension> Set the top, right, bottom and left margins to the same
value.

header (style):
Change the header.

Expand Down
22 changes: 13 additions & 9 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,6 @@ Comande line interface
file.
--s3, --styles-v3 List all possible version 3 styles.
--s4, --styles-v4 List all possible version 4 styles.
--staff-space <dimension>
Set the staff space or spatium. This is the vertical
distance between two lines of a music staff.
--page-size <width> <height>
Set the page size.
--a4, --din-a4 Set the paper size to DIN A4 (210 by 297 mm).
--letter Set the paper size to Letter (8.5 by 11 in).
--margin <dimension> Set the top, right, bottom and left margins to the same
value.
--reset-small-staffs Reset all small staffs to normal size.

font (style):
Expand All @@ -222,6 +213,19 @@ Comande line interface
--musical-text-font <font-face>
Set “musicalTextFont”.

page (style):
Page settings.

--staff-space <dimension>
Set the staff space or spatium. This is the vertical
distance between two lines of a music staff.
--page-size <width> <height>
Set the page size.
--a4, --din-a4 Set the paper size to DIN A4 (210 by 297 mm).
--letter Set the paper size to Letter (8.5 by 11 in).
--margin <dimension> Set the top, right, bottom and left margins to the same
value.

header (style):
Change the header.

Expand Down
12 changes: 7 additions & 5 deletions mscxyz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,9 @@ def setup_parser() -> argparse.ArgumentParser:
help="Set “musicalTextFont”.",
)

style_group.add_argument(
page_group = parser.add_argument_group("page (style)", "Page settings.")

page_group.add_argument(
"--staff-space",
dest="style_staff_space",
type=mm,
Expand All @@ -581,30 +583,30 @@ def setup_parser() -> argparse.ArgumentParser:
"two lines of a music staff.",
)

style_group.add_argument(
page_group.add_argument(
"--page-size",
dest="style_page_size",
nargs=2,
metavar=("<width>", "<height>"),
help="Set the page size.",
)

style_group.add_argument(
page_group.add_argument(
"--a4",
"--din-a4",
dest="style_page_size_a4",
action="store_true",
help="Set the paper size to DIN A4 (210 by 297 mm).",
)

style_group.add_argument(
page_group.add_argument(
"--letter",
dest="style_page_size_letter",
action="store_true",
help="Set the paper size to Letter (8.5 by 11 in).",
)

style_group.add_argument(
page_group.add_argument(
"--margin",
dest="style_margin",
metavar="<dimension>",
Expand Down
14 changes: 9 additions & 5 deletions mscxyz/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,25 @@ class DefaultArguments:
style_file: Optional[TextIOWrapper] = None
style_styles_v3: bool = False
style_styles_v4: bool = False
style_list_fonts: bool = False
style_text_font: Optional[str] = None
style_title_font: Optional[str] = None
style_musical_symbol_font: Optional[str] = None
style_musical_text_font: Optional[str] = None
# page
style_staff_space: Optional[float] = None
style_page_size: Optional[tuple[str, str]] = None
style_page_size_a4: bool = False
style_page_size_letter: bool = False
style_margin: Optional[str] = None
# font
style_list_fonts: bool = False
style_text_font: Optional[str] = None
style_title_font: Optional[str] = None
style_musical_symbol_font: Optional[str] = None
style_musical_text_font: Optional[str] = None
# header
style_show_header: Optional[bool] = None
style_header_first_page: Optional[bool] = None
style_different_odd_even_header: Optional[bool] = None
style_header_all: Optional[tuple[str, str, str]] = None
style_header_odd_even: Optional[tuple[str, str, str, str, str, str]] = None
# footer
style_different_odd_even_footer: Optional[bool] = None
style_show_footer: Optional[bool] = None
style_footer_first_page: Optional[bool] = None
Expand Down

0 comments on commit 3396245

Please sign in to comment.