Loading

Paste #pjqsu4obu

  1. diff -r 5526d64e6def webtranslate/newgrf/language_file.py
  2. --- a/webtranslate/newgrf/language_file.py  Mon May 25 17:14:35 2015 +0200
  3. +++ b/webtranslate/newgrf/language_file.py  Mon May 25 17:59:35 2015 +0200
  4. @@ -420,7 +420,7 @@
  5.      @type plurals: C{list} of C{int}
  6.  
  7.      @ivar commands: String commands at each position.
  8. -    @type commands: C{list} of C{ParameterInfo}
  9. +    @type commands: C{list} of L{ParameterInfo}
  10.  
  11.      @ivar non_positionals: Mapping of commands without position to their count.
  12.      @type non_positionals: C{dict} of C{str} to C{int}
  13. @@ -614,8 +614,7 @@
  14.          ok = True
  15.          for pos, cmd in enumerate(self.commands):
  16.              if cmd is None:
  17. -                self.add_error(ErrorMessage(ERROR, None, "String parameter {} has no string command".format(pos)))
  18. -                ok = False
  19. +                self.commands[pos] = project_type.SKIP_PARAMETER;
  20.          if ok:
  21.              for pos in self.plurals:
  22.                  if pos < 0 or pos >= len(self.commands):
  23. @@ -1034,6 +1033,8 @@
  24.          sc = project_type.NL_PARAMETER
  25.      elif name == '{':
  26.          sc = project_type.CURLY_PARAMETER
  27. +    elif name == 'SKIP':
  28. +        sc = project_type.SKIP_PARAMETER
  29.      else:
  30.          sc = projtype.text_commands.get(name)
  31.          if sc is None: return True
  32. diff -r 5526d64e6def webtranslate/project_type.py
  33. --- a/webtranslate/project_type.py  Mon May 25 17:14:35 2015 +0200
  34. +++ b/webtranslate/project_type.py  Mon May 25 17:59:35 2015 +0200
  35. @@ -319,6 +319,7 @@
  36.  
  37.  NL_PARAMETER    = ParameterInfo("",  False, False, False, False, False)
  38.  CURLY_PARAMETER = ParameterInfo("{", False, False, False, False, False)
  39. +SKIP_PARAMETER  = ParameterInfo("SKIP", True, False, False, False, False)
  40.  
  41.  
  42.  # Available project types, ordered by internal name.
  43.  

Comments