From 51d65a141d67135c5d4444886e9934c2b7010584 Mon Sep 17 00:00:00 2001 From: Rebecca Heineman Date: Sun, 6 Oct 2024 00:56:20 -0500 Subject: [PATCH] build_objects.py is documented --- makeprojects/build_objects.py | 26 +++++++++++++++----------- makeprojects/watcom.py | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/makeprojects/build_objects.py b/makeprojects/build_objects.py index 965b77c..afc71c3 100644 --- a/makeprojects/build_objects.py +++ b/makeprojects/build_objects.py @@ -72,15 +72,18 @@ def __repr__(self): A full error string. """ - if self.error: + error = self.error + if error: result = "Error #{} in file {}".format(self.error, self.filename) else: result = "No error in file {}".format(self.filename) - if self.configuration: + configuration = self.configuration + if configuration: result += " Configuration \"{}\"".format(self.configuration) - if self.msg: - result += " \"{}\"".format(self.msg) + msg = self.msg + if msg: + result += " \"{}\"".format(msg) return result @@ -130,13 +133,13 @@ def __init__(self, file_name, priority=None, if priority is None: priority = 50 - # Ensure the pathname is an absolute path - file_name = os.path.abspath(file_name) + # Filename of this build object + self.file_name = os.path.abspath(file_name) - self.file_name = file_name - - # Ensure it's a number + # Set the priority number self.priority = int(priority) + + # Configuration linked to this object self.configuration = configuration ######################################## @@ -212,8 +215,9 @@ def __repr__(self): self.file_name, self.priority) - if self.configuration: - result += " configuration \"{}\"".format(self.configuration) + configuration = self.configuration + if configuration: + result += " configuration \"{}\"".format(configuration) return result diff --git a/makeprojects/watcom.py b/makeprojects/watcom.py index 90c06a7..595f2b0 100644 --- a/makeprojects/watcom.py +++ b/makeprojects/watcom.py @@ -15,11 +15,14 @@ @package makeprojects.watcom +@var makeprojects.watcom.SUPPORTED_IDES +List of IDETypes the watcom module supports. + @var makeprojects.watcom._WATCOMFILE_MATCH Regex for matching files with *.wmk -@var makeprojects.watcom.SUPPORTED_IDES -List of IDETypes the watcom module supports. +@var makeprojects.watcom._WMAKE_DO_NOTHING +String to do nothing in WMAKE """ # pylint: disable=consider-using-f-string @@ -68,7 +71,7 @@ class BuildWatcomFile(BuildObject): """ def __init__(self, file_name, priority, configuration, verbose=False): - """ + r""" Class to handle watcom make files Args: @@ -312,7 +315,8 @@ def generate(solution): class WatcomProject(object): """ - Root object for a Watcom IDE project file + Root object for a Watcom IDE project file. + Created with the name of the project, the IDE code the platform code (4gw, x32, win) @@ -328,6 +332,9 @@ class WatcomProject(object): def __init__(self, solution): """ Initialize the exporter. + + Args: + solution: Parent solution. """ self.solution = solution @@ -1357,6 +1364,7 @@ def write_builds(self, line_list, has_rez): Args: line_list: List of lines of text generated. + has_rez: Is there a Windows Resource file to link in Returns: Zero """