Skip to content

Instantly share code, notes, and snippets.

@piranha
Last active January 3, 2025 20:56

Revisions

  1. piranha revised this gist Aug 23, 2013. 1 changed file with 11 additions and 8 deletions.
    19 changes: 11 additions & 8 deletions пше
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@
    #
    # This incredible piece of code makes git a bit Polish, a bit Western Ukrainian,
    # пше прошу пана
    # Joke is based on the fact that 'git' is 'пше' in qwerty/йцукен layouts
    #
    # Joke is based on fact that 'git' is 'пше' in qwerty/йцукен layouts
    #
    # (c) 2013 Alexander Solovyov under terms of WTFPL

    import sys
    @@ -40,9 +40,12 @@ def main(args):
    if __name__ == '__main__':
    if len(sys.argv) > 1:
    sys.exit(main(sys.argv[1:]))
    print 'Usage: пше команда опции'
    print ' Используйте транслитерированные команды, например:'
    print ' - пше цоммит -м "инитиал цоммит"'
    print ' - пше цомміт -м "інітіал цомміт"'
    print ' - пше лог'
    print ' - пше пуш'
    print 'Usage: пше цомманд оптионс -> git command options'
    print ''
    print 'Пше гіт версіон 0.1'
    print ''
    print 'Используйте транслитерированные команды, например:'
    print ' - пше цоммит -м "инитиал цоммит"'
    print ' - пше цомміт -м "інітіал цомміт"'
    print ' - пше лог'
    print ' - пше пуш'
  2. piranha revised this gist Aug 23, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion пше
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    #
    # This incredible piece of code makes git a bit Polish, a bit Western Ukrainian,
    # пше прошу пана
    # Joke is based on fact that 'git' is 'пше' in qwerty/йцукен layouts
    # Joke is based on the fact that 'git' is 'пше' in qwerty/йцукен layouts
    #
    # (c) 2013 Alexander Solovyov under terms of WTFPL

  3. piranha revised this gist Aug 23, 2013. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion пше
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@
    #
    # This incredible piece of code makes git a bit Polish, a bit Western Ukrainian,
    # пше прошу пана
    # Joke is based on fact that 'git' is 'пше' in qwerty/йцукен layouts
    #
    # (c) 2013 Alexander Solovyov under terms of WTFPL

    import sys
    @@ -36,4 +38,11 @@ def main(args):


    if __name__ == '__main__':
    sys.exit(main(sys.argv[1:]))
    if len(sys.argv) > 1:
    sys.exit(main(sys.argv[1:]))
    print 'Usage: пше команда опции'
    print ' Используйте транслитерированные команды, например:'
    print ' - пше цоммит -м "инитиал цоммит"'
    print ' - пше цомміт -м "інітіал цомміт"'
    print ' - пше лог'
    print ' - пше пуш'
  4. piranha revised this gist Aug 23, 2013. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions пше
    Original file line number Diff line number Diff line change
    @@ -6,13 +6,17 @@
    # (c) 2013 Alexander Solovyov under terms of WTFPL

    import sys
    from subprocess import check_output
    from subprocess import call


    # commit <- цомміт, дамміт :(
    table = dict(zip(u'а б в г д е ë ж з и й к л м н о п р с '
    u'т у ф х ц ч ш щ ь ы ъ э ю я'.split(),
    u'a b v g d e e zh z i j k l m n o p r s '
    u't u f h c ch sh sch \' y \' e yu ya'.split()))
    table[u'і'] = 'i'
    table[u'є'] = 'e'
    table[u'ї'] = 'yi' # їєлд -> yield :-)


    def transletter(l):
    @@ -28,8 +32,8 @@ def transliterate(s):

    def main(args):
    args = map(transliterate, args)
    print check_output(['git'] + args)
    return call(['git'] + args)


    if __name__ == '__main__':
    main(sys.argv[1:])
    sys.exit(main(sys.argv[1:]))
  5. piranha created this gist Aug 23, 2013.
    35 changes: 35 additions & 0 deletions пше
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    #!/usr/bin/env python
    # -*- mode: python, coding: utf-8 -*-
    #
    # This incredible piece of code makes git a bit Polish, a bit Western Ukrainian,
    # пше прошу пана
    # (c) 2013 Alexander Solovyov under terms of WTFPL

    import sys
    from subprocess import check_output


    table = dict(zip(u'а б в г д е ë ж з и й к л м н о п р с '
    u'т у ф х ц ч ш щ ь ы ъ э ю я'.split(),
    u'a b v g d e e zh z i j k l m n o p r s '
    u't u f h c ch sh sch \' y \' e yu ya'.split()))


    def transletter(l):
    if l.lower() not in table:
    return l
    n = table[l.lower()]
    return n.upper() if l.isupper() else n


    def transliterate(s):
    return ''.join(map(transletter, s.decode('utf-8')))


    def main(args):
    args = map(transliterate, args)
    print check_output(['git'] + args)


    if __name__ == '__main__':
    main(sys.argv[1:])