From 011024f0a41dc27d6e05630384d05d84fccf7564 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Fri, 18 Oct 2019 19:06:07 +0200 Subject: [PATCH] TrayLayout: Add comment to clarify the purpose of the classes Resolves: #179 --- boxes/generators/traylayout.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/boxes/generators/traylayout.py b/boxes/generators/traylayout.py index ae91665..c42279b 100644 --- a/boxes/generators/traylayout.py +++ b/boxes/generators/traylayout.py @@ -22,6 +22,8 @@ import argparse class TrayLayout(Boxes): """Generate a typetray from a layout file""" + # This class generates the skeleton text file that can then be edited + # to describe the actual box webinterface = True @@ -40,6 +42,9 @@ class TrayLayout(Boxes): "--output", action="store", type=str, default="traylayout.txt", help="name of the layout text file") + # Use empty open and close methods to avoid initializing the whole + # drawing infrastructure + def open(self): pass @@ -76,6 +81,9 @@ class TrayLayout(Boxes): class TrayLayout2(TrayLayout): """Generate a typetray from a layout file""" + # This class reads in the layout either from a file (with --input) or + # as string (with --layout) and turns it into a drawing for a box. + webinterface = True def __init__(self, input=None, webargs=False): @@ -92,6 +100,7 @@ class TrayLayout2(TrayLayout): self.argparser.add_argument( "--layout", action="store", type=str) + # Use normal open and close open = Boxes.open close = Boxes.close