[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Pology posummit templates fails on python lambda error
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2013-01-18 22:17:09
Message-ID: 201301182317.09992.caslav.ilic () gmx ! net
[Download RAW message or body]


> [: Tomáš Chvátal :]
> then I have problem. I thought the conversion is done only for the po
> files not the pot ones.
> [...]
>   yast/50-pot/you-server.pot
>   yast/cs/po/you-server.cs.po

You can check if input path ends with .pot, if it does do one thing, and if
it doesn't do another thing.

> Also I stole that code from the web documentation of pology :-)

But not exactly the same, and the devil is in the details! Which means I
should add more notes to that example...

> Btw as this is wip is there some possibility to loop over all the
> translation dirs so I can set something like S.package which can get
> values of "yast webyast packages lcn" so I don't have to setup the dict
> for each of those separately?

Since summit setup is a Python code file, you can in principle do anything
that you wish in there to construct the branch dictionaries. E.g. you can
get that output, parse it, and then add dictionaries in a loop:

  branch_specs = []
  # ...
  # Parse something to fill the list of tuples branch_specs,
  # where each tuple contains branch ID and other necessary branch data.
  # ...

  # Setup branches.
  for branch_spec in branch_specs:
      branch_id, ... = branch_spec
      S.branches.append(
          dict(id=branch_id,
               ...))

For any scripted funcionality that seems to be more general than given case
alone, I would of course consider adding special support...

-- 
Chusslove Illich (Часлав Илић)

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic