Exemplo n.º 1
0
 def _validate_worksheet_row(self, row):
     if not (row.get(self.TYPE_HEADER) and row.get(self.OLD_ID_HEADER)
             and row.get(self.NEW_ID_HEADER)):
         raise TransifexProjectMigrationInvalidUpload(
             _("missing value(s) in sheet"))
     if not row.get(self.TYPE_HEADER) in ['Menu', 'Form']:
         raise TransifexProjectMigrationInvalidUpload(
             _("Could not load file. 'Type' column should be either 'Menu' or 'Form'"
               ))
Exemplo n.º 2
0
 def _validate_worksheet_headers(self, headers):
     if (self.TYPE_HEADER not in headers
             or self.OLD_ID_HEADER not in headers
             or self.NEW_ID_HEADER not in headers):
         raise TransifexProjectMigrationInvalidUpload(
             _("Could not load file. Please ensure columns %s, %s and %s are present"
               ) %
             (self.TYPE_HEADER, self.OLD_ID_HEADER, self.NEW_ID_HEADER))
Exemplo n.º 3
0
 def _validate_worksheet_headers(self, headers):
     if (self.TYPE_HEADER not in headers
             or self.OLD_ID_HEADER not in headers
             or self.NEW_ID_HEADER not in headers):
         raise TransifexProjectMigrationInvalidUpload(
             _("Could not load file. Please ensure columns {type_header}, "
               "{old_id_header} and {new_id_header} are present").format(
                   type_header=self.TYPE_HEADER,
                   old_id_header=self.OLD_ID_HEADER,
                   new_id_header=self.NEW_ID_HEADER,
               ))