Skip to content

Instantly share code, notes, and snippets.

@jakul
Created January 4, 2012 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakul/1560255 to your computer and use it in GitHub Desktop.
Save jakul/1560255 to your computer and use it in GitHub Desktop.
def _pofile_or_mofile(f, type, **kwargs):
# ... snip
default_klass = type == 'pofile' and POFile or MOFile
klass = kwargs.get('klass', default_klass)
parser = kls(
f,
encoding=enc,
check_for_duplicates=kwargs.get('check_for_duplicates', False),
klass=klass,
)
# ... snip
class _POFileParser(object):
def __init__(self, pofile, *args, **kwargs):
# ... snip
klass = kwargs.get('klass', POFile)
# ... snip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment