Skip to content

Commit

Permalink
small corrections (#1079)
Browse files Browse the repository at this point in the history
* Update README.md

* Update formatters.py

* Update formatters.py
  • Loading branch information
shubham-shahh committed Oct 14, 2021
1 parent 00dd602 commit 37b4bfe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions Autocoders/Python/src/fprime_ac/generators/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _dlog(self, ddt, arg):

def _strip_without_code(self, line_list):
"""
Protected method that strips spaces, carriage returns etc. off each line
A Protected method that strips spaces, carriage returns, etc. off each line
in the list of lines. Except that lines between a start @code line and
an end @code line are left alone.
Expand Down Expand Up @@ -175,7 +175,7 @@ def _commentWrap(self, message, text, length):
def commentDraw(self, user_comment, arguments, type="iface", check_and_send=False):
"""
This method is used to format the comments for a function. The
comments will includes information about each argument. The text
comments will include information about each argument. The text
is formatted in doxygen style.
"""

Expand Down Expand Up @@ -269,7 +269,7 @@ def commentDraw(self, user_comment, arguments, type="iface", check_and_send=Fals
def commentHeaderFormat(self, comment_stuff, type="iface"):
"""
Method to format header comments and add interface type label. No limit
on line length imposed so it is assumed the XML is reasonable length
on line length is imposed so it is assumed the XML is of reasonable length
text lines. Recognizes @code directives for doxygen.
"""

Expand Down Expand Up @@ -383,8 +383,8 @@ def commentFormat(self, stuff_in_brackets):
if len_with_word < 76:
this_line = this_line + " " + this_word
else:
# This even handles case where this_word is longer than line limit
# remember to get rid of the trailing space at end of line
# This even handles the case where this_word is longer than the line limit
# remember to get rid of the trailing space at end of the line
self._dlog(ddt2, "...append formatted_comment here.")
if formatted_comment == "":
if this_line != "":
Expand Down Expand Up @@ -417,9 +417,9 @@ class Formatters:
Class that provides a collection of routines to format strings for
code generation. The start of this class is generic for doing
all sorts of string name manipulations for formatting.
The rest of these routines a legacy for rename things toward
The rest of these routines are a legacy for renaming things towards
the MSL naming conventions or test something exists. As time
goes by the MSL naming routines will be removed and replaced
goes by, the MSL naming routines will be removed and replaced
by newer ones.
"""

Expand Down Expand Up @@ -452,7 +452,7 @@ def _dlog(self, ddt, arg):

def capFirstCharTuple3(self, t, en):
"""
For three element tuple capitalize first character of select
For three element tuple capitalize the first character of select
elements. They are enabled by binary bits (e.g. en=111 sets
each element, en=010 set element 1, etc.)
@param t: A three element tuple
Expand All @@ -475,7 +475,7 @@ def capFirstCharTuple3(self, t, en):

def capFirstChar(self, s):
"""
Capitalize first character of string name.
Capitalize the first character of string name.
"""
return s[0].upper() + s[1:]

Expand Down Expand Up @@ -618,7 +618,7 @@ def msgTypedefName(self, id, name, name_sep="AcMsg"):
def msgUnionArgName(self, msg_type):
"""
Return the name of a standard argument for a union
used to determine maximum size of a message type.
used to determine the maximum size of a message type.
@param msg_type: The Typedef msg name (must include 'AcMsg')
"""
if -1 != msg_type.find("AcMsg"):
Expand Down Expand Up @@ -702,11 +702,11 @@ def opcodeStemName(self, id, name):
# Check characters
if len(re.findall("[^A-Z0-9_]", name_string)) != 0:
PRINT.info(
"ERROR: DETECTED INVALID CHARACTER IN COMMAND STEM NAME (%s)."
"ERROR: DETECTED AN INVALID CHARACTER IN COMMAND STEM NAME (%s)."
% name_string
)
raise Exception(
"Fatal error detected invalid character in command stem name."
"Fatal error, detected an invalid character in command stem name."
)
# All is ok
return name_string
Expand All @@ -718,7 +718,7 @@ def opcodeStemNameValidate(self, id, cmd_name_list):
names than through exception and stop
everything.
@param cmd_name_list: list of command function names.
@return: TRUE if all command stem names are unique, else raise exception.
@return: TRUE if all command stem names are unique, else raise an exception.
"""
cmds = list()

Expand Down Expand Up @@ -797,7 +797,7 @@ def oneLineFun(self, name, args):
If there is a comment with any arg
then pad the function with 80 " "
so arguments will format on new line.
@param name: Name of function.
@param name: Name of the function.
@param args: List of argument tuples.
"""
if self.commentInArgsPresent(args) == True:
Expand All @@ -816,7 +816,7 @@ def oneLineFun(self, name, args):

def formComment(self, comment):
"""
If comment greater then max truncate
If comment greater than max truncate
and add '...' else leave it alone.
If comment is not "" prefix with '///< '.
Expand Down Expand Up @@ -877,7 +877,7 @@ def formatFunCall(self, name, args, indent=0, prefix=""):
def simpleFuncDraw(self, name, args, proto=True, indent=0):
"""
This is a simple C function formatter. The arguments are a function
name, and its arguments. A string is returned that is a C code
name and its arguments. A string is returned that is a C code
function declaration. The proto flag is used to properly terminate
the function.
"""
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def formatFunCommentOldVersion(self, name, args, proto=True, indent=0):
Method to format a function line
formatFun but add argument comments
if they exist.
@param name: Name of function.
@param name: Name of the function.
@param args: List of arguments in tuple form.
@param proto: Prototype flag for non-header file use.
"""
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Migration considerations:
* Usage of framework can be out-of-source
* `settings.ini` Introduced
* Example: [https://github.com/fprime-community/fprime-arduino](https://github.com/fprime-community/fprime-arduino)
* Refactored `fprim-util`
* Refactored `fprime-util`
* Replaced redundant targets with flags e.g. build-ut is now build --ut
* Added `info` command
* Bug and usability fixes
Expand Down

0 comments on commit 37b4bfe

Please sign in to comment.