@@ -0,0 +1,1112 @@
+%22%22%22%0ATools for automating daily tasks.%0A%22%22%22%0Afrom fabric.api import local%0Afrom fabric.colors import red, green%0A%0Adef i18n_upload():%0A    %22%22%22Update source language, and upload to Transifex.%0A    %22%22%22%0A    _debug('django-admin.py makemessages -l en -e py,html -i %22thirdpart*%22')%0A    local('django-admin.py makemessages -l en -e py,html -i %22thirdpart*%22')%0A%0A    # some version of makemessages will produce %22%25%25%22 in the string, replace that%0A    # to %22%25%22.%0A    _inplace_change('locale/en/LC_MESSAGES/django.po', '%25%25', '%25')%0A%0A    _debug('tx push -s')%0A    local('tx push -s')%0A%0Adef i18n_pull():%0A    %22%22%22Update local po files with Transifex.%0A    %22%22%22%0A    _debug('tx pull')%0A    local('tx pull')%0A%0A########## utility functions%0Adef _inplace_change(filename, old_string, new_string):%0A    s = open(filename).read()%0A    if old_string in s:%0A        print(green('Changing %22%7Bold_string%7D%22 to %22%7Bnew_string%7D%22 in %22%7Bfilename%7D%22'.format(**locals())))%0A        s = s.replace(old_string, new_string)%0A        f = open(filename, 'w')%0A        f.write(s)%0A        f.flush()%0A        f.close()%0A%0Adef _debug(msg):%0A    print(red('Running: %7Bmsg%7D'.format(**locals())))%0A

Add fabric file