Skip to content

Commit

Permalink
Use function naming convention in longtables
Browse files Browse the repository at this point in the history
Previously, the two new functions did not use the naming convention.
This caught me in the example commit, so it will likely catch someone
who didn't write the code.
Longtable commands now use end_table_<last>_<header|footer>().
  • Loading branch information
JarrahGos committed Jun 16, 2017
1 parent 1857e9c commit 60f760c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/longtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ def genenerate_longtabu():
data_table.add_hline()
data_table.add_row(["header 1", "header 2", "header 3"])
data_table.add_hline()
data_table.end_head()
data_table.end_table_header()
data_table.add_hline()
data_table.add_row((MultiColumn(3, align='r',
data='Containued on Next Page'),))
data_table.add_hline()
data_table.end_foot()
data_table.end_table_footer()
data_table.add_hline()
data_table.add_row((MultiColumn(3, align='r',
data='Not Containued on Next Page'),))
data_table.add_hline()
data_table.end_last_foot()
data_table.end_table_last_footer()
row = ["Content1", "9", "Longer String"]
for i in range(150):
data_table.add_row(row)
Expand Down
4 changes: 2 additions & 2 deletions pylatex/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def end_table_header(self):

self.append(Command(r'endhead'))

def end_foot(self):
def end_table_footer(self):
r"""End the table foot which will appear on every page."""

if self.foot:
Expand All @@ -479,7 +479,7 @@ def end_foot(self):

self.append(Command('endfoot'))

def end_last_foot(self):
def end_table_last_footer(self):
r"""End the table foot which will appear on the last page."""

if self.lastFoot:
Expand Down

0 comments on commit 60f760c

Please sign in to comment.