Skip to content

Commit

Permalink
build_objects.py is documented
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerbecky committed Oct 6, 2024
1 parent e256100 commit 51d65a1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
26 changes: 15 additions & 11 deletions makeprojects/build_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

########################################
Expand Down Expand Up @@ -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

Expand Down
16 changes: 12 additions & 4 deletions makeprojects/watcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -68,7 +71,7 @@ class BuildWatcomFile(BuildObject):
"""

def __init__(self, file_name, priority, configuration, verbose=False):
"""
r"""
Class to handle watcom make files
Args:
Expand Down Expand Up @@ -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)
Expand All @@ -328,6 +332,9 @@ class WatcomProject(object):
def __init__(self, solution):
"""
Initialize the exporter.
Args:
solution: Parent solution.
"""

self.solution = solution
Expand Down Expand Up @@ -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
"""
Expand Down

0 comments on commit 51d65a1

Please sign in to comment.