| 103 | def format_filterexpressions(self, formatter=None) : |
| 104 | """Formats filter expressions our way.""" |
| 105 | if formatter is None : |
| 106 | formatter = self.formatter |
| 107 | result = [] |
| 108 | if self.filterexpressions : |
| 109 | result.append(formatter.format_heading(_("filtering expressions"))) |
| 110 | formatter.indent() |
| 111 | result.append(formatter.format_description(_("Use the filtering expressions to extract only parts of the datas. Allowed filters are of the form 'key=value'."))) |
| 112 | result.append("\n") |
| 113 | result.append(formatter.format_heading(_("allowed keys for now"))) |
| 114 | formatter.indent() |
| 115 | for (expression, explanation) in self.filterexpressions : |
| 116 | result.append(formatter.format_description("%s : %s" % (expression, explanation))) |
| 117 | formatter.dedent() |
| 118 | result.append("\n") |
| 119 | result.append(formatter.format_heading(_("formatting of dates with the 'start' and 'end' filtering keys"))) |
| 120 | formatter.indent() |
| 121 | result.append(formatter.format_description(_("YYYY : year boundaries"))) |
| 122 | result.append(formatter.format_description(_("YYYYMM : month boundaries"))) |
| 123 | result.append(formatter.format_description(_("YYYYMMDD : day boundaries"))) |
| 124 | result.append(formatter.format_description(_("YYYYMMDDhh : hour boundaries"))) |
| 125 | result.append(formatter.format_description(_("YYYYMMDDhhmm : minute boundaries"))) |
| 126 | result.append(formatter.format_description(_("YYYYMMDDhhmmss : second boundaries"))) |
| 127 | result.append(formatter.format_description(_("yesterday[+-N] : yesterday more or less N days (e.g. : yesterday-15)"))) |
| 128 | result.append(formatter.format_description(_("today[+-N] : today more or less N days (e.g. : today-15)"))) |
| 129 | result.append(formatter.format_description(_("tomorrow[+-N] : tomorrow more or less N days (e.g. : tomorrow-15)"))) |
| 130 | result.append(formatter.format_description(_("now[+-N] : now more or less N days (e.g. now-15)"))) |
| 131 | formatter.dedent() |
| 132 | result.append("\n") |
| 133 | return "".join(result) |
| 134 | |
| 135 | |
| 136 | #'now' and 'today' are not exactly the same since today represents the first |
| 137 | #or last second of the day depending on if it's used in a start= or end= |
| 138 | #date expression. The utility to be able to specify dates in the future is |
| 139 | #a question which remains to be answered :-) |
| 140 | # |
| 141 | #Contrary to other PyKota management tools, wildcard characters are not |
| 142 | #expanded, so you can't use them. |
| 143 | |