Skip to content

Commit

Permalink
Merge pull request faif#197 from grepsean/add_main
Browse files Browse the repository at this point in the history
Added a condition checking __main__
  • Loading branch information
faif authored Jun 12, 2017
2 parents 4c7e053 + 610e5c3 commit e3d1dd0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions creational/factory_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ def get_localizer(language="English"):
return languages[language]()


# Create our localizers
e, g = get_localizer(language="English"), get_localizer(language="Greek")
# Localize some text
for msgid in "dog parrot cat bear".split():
print(e.get(msgid), g.get(msgid))
if __name__ == '__main__':
# Create our localizers
e, g = get_localizer(language="English"), get_localizer(language="Greek")
# Localize some text
for msgid in "dog parrot cat bear".split():
print(e.get(msgid), g.get(msgid))

### OUTPUT ###
# dog σκύλος
Expand Down

0 comments on commit e3d1dd0

Please sign in to comment.