예제 #1
0
    def getFullAddressTex(self):
        # do it this way because self.address could be None, and we don't want 'None' to be displayed
        address = getattr(self, 'address', None) or ''

        result = '''%s\\\\
                    %s''' % (escapeTex(address),
                             escapeTex(self.getCityStateZip()))
        return result
예제 #2
0
 def getSignatureFormlines(self):
     'Generate form lines for all FULL signatures (not getInitialsFooterLines) on the lease'
     result = []
     for person in self.getSigningPeople():
         signatureImage = self.getSignatureContentIfNecessary(person,
                                                              '\\raisebox{-15pt}{\\smash{\\includegraphics[height=50pt]{%s}}}'
                                                              % person.getSignatureRelativePath())
         signatureDate = self.getSignatureContentIfNecessary(person,
                                                             '\\raisebox{3pt}{%s}'
                                                             % Date())
         result.append('\\formLine[%s]{%s~- Signature}\\nopagebreak' % (signatureImage, escapeTex(person)))
         result.append('\\formLine[%s]{%s~- Date}' % (signatureDate, escapeTex(person)))
     return '\n'.join(result)
예제 #3
0
 def getInitialsFooterLines(self, person):
     signatureContent = self.getSignatureContentIfNecessary(person,
                                                            '\\hspace{0.3cm}\\smash{\\includegraphics[width=1.3cm]{%s}}'
                                                            % person.getInitialsRelativePath())
     dateContent = self.getSignatureContentIfNecessary(person,
                                                       '\\raisebox{3pt}{%s}'
                                                       % Date())
     result = '''
         \\vspace{7pt}\\small {%s} %s
         \\makebox[\\initialsSpaceWidth]{\\hrulefill}
         \\small Date %s
         \\makebox[\\initialsSpaceWidth]{\\hrulefill}%%
     ''' % (escapeTex(person), signatureContent, dateContent)
     return result
예제 #4
0
    def getIngredientsTable(self):
        columnSpec = ['l']
        headings = ['Item']
        for b in sorted(self.batches):
            columnSpec.append('c')
            # 'Single Batch', 'Double Batch', etc.
            if len(self.batches) == 1 and b == 1:
                # if we're only doing a single batch, don't mention batches.
                headings.append('Quantity')
            else:
                headings.append('%s Batch' % BATCH_NAMES[b])
        columnSpec.append('l')
        headings.append('Preparation/Notes')

        rows = []
        for ingredientSection in self.ingredientSectionOrder:
            if ingredientSection:
                rows.append('')
                rows.append(bold(escapeTex(ingredientSection)))
            for ingredient in self.ingredients[ingredientSection]:
                if ingredient is None:
                    # it's just a space between groupings
                    rows.append('')
                else:
                    columns = [ingredient.name]
                    for batch in sorted(self.batches):
                        if ingredient.quantity is None:
                            columns.append('')
                        else:
                            # ingredient.quantity will be either int, float, or Quantity
                            q = ingredient.quantity * batch
                            columns.append(self.quantityString(q))
    
                    notes = self.doStandardTexReplacements(ingredient.notes)
                    columns.append('\\parbox[t]{0.4\\textwidth}{%s}' % notes)
                    rows.append(' & '.join(columns))

        headingString = ' & '.join(['\\textbf{%s}' % h for h in headings])
        result = '''
            \\begin{tabular}{%s}
                %s \\\\
                \\hline
                %s
            \\end{tabular}
        ''' % (' '.join(columnSpec),
               headingString,
               ' \\\\\n'.join(rows))
        return result