diff --git a/.travis.yml b/.travis.yml index 1cc78f06e..4edc4d85e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,6 @@ install: after_success: - python scripts/pretty.py - python scripts/readme.py -- stat .git -- ls -- pwd - chmod +x .travis/push.sh - .travis/push.sh skip_cleanup : true diff --git a/.travis/push.sh b/.travis/push.sh index faa9b8afc..9f72fad21 100755 --- a/.travis/push.sh +++ b/.travis/push.sh @@ -7,7 +7,6 @@ commit_website_files() { if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then if [ $TRAVIS_BRANCH == "master" ]; then echo "Committing to master branch..." - git checkout master git status git add -A git status @@ -26,7 +25,7 @@ upload_files() { if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then if [ $TRAVIS_BRANCH == "master" ]; then echo "Pushing to master branch..." - git push --force --quiet "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" master > /dev/null 2>&1 + git push --force "https://${GH_TOKEN}@github.com/kriadmin/30-seconds-of-python-code.git" master fi fi } diff --git a/requirements.txt b/requirements.txt index 5bab87ff8..c7b0fd7e2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -yapf==0.20.0 \ No newline at end of file +autopep8==1.3.3 \ No newline at end of file diff --git a/scripts/pretty.py b/scripts/pretty.py index b74c57a18..c3c4daad6 100644 --- a/scripts/pretty.py +++ b/scripts/pretty.py @@ -1,4 +1,4 @@ -from yapf.yapflib.yapf_api import FormatCode +import autopep8 import re import os files = os.listdir('snippets') @@ -8,7 +8,7 @@ for file in files: fileData = someFile.read() someFile.close() originalCode = re.search(codeRe,fileData).group(0) - formatedCode = FormatCode(re.split(codeRe,fileData)[1]) + formatedCode = autopep8.fix_code(re.split(codeRe,fileData)[1]) fileToSave = fileData.replace(originalCode,('```python \n'+formatedCode[0]+'\n```')) someFile = open("snippets/"+file,'w') someFile.write(fileToSave)