Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix .editorconfig for python indentation. #1263

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ root = true
[*.{js,py}]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.js]
indent_size = 2

[*.py]
indent_size = 4

# Following JS code style rules do not have EditorConfig support yet:
# - Use identity operators (===) over equality operators (==).
# - Opening brace at end of line. e.g. "if(a) {", "} else {", "} else if (b) }"
Expand Down
30 changes: 15 additions & 15 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,27 @@ def loaderMD(var):
# use different MD.dat's for python 2 vs 3 incase user switches versions, as they are not compatible
db = shelve.open('build/MDv' + str(sys.version_info[0]) + '.dat')
if 'files' in db:
files = db['files']
files = db['files']
else:
files = {}
files = {}
file = readfile(fn)
filemd5 = hashlib.md5(file.encode('utf8')).hexdigest()
# check if file has already been parsed by the github api
if fn in files and filemd5 in files[fn]:
# use the stored copy if nothing has changed to avoid hitting the api more then the 60/hour when not signed in
db.close()
return files[fn][filemd5]
# use the stored copy if nothing has changed to avoid hitting the api more then the 60/hour when not signed in
db.close()
return files[fn][filemd5]
else:
url = 'https://api.github.com/markdown'
payload = {'text': file, 'mode': 'markdown'}
headers = {'Content-Type': 'application/json'}
req = urllib2.Request(url, json.dumps(payload).encode('utf8'), headers)
md = urllib2.urlopen(req).read().decode('utf8').replace('\n', '\\n').replace('\'', '\\\'')
files[fn] = {}
files[fn][filemd5] = md
db['files'] = files
db.close()
return md
url = 'https://api.github.com/markdown'
payload = {'text': file, 'mode': 'markdown'}
headers = {'Content-Type': 'application/json'}
req = urllib2.Request(url, json.dumps(payload).encode('utf8'), headers)
md = urllib2.urlopen(req).read().decode('utf8').replace('\n', '\\n').replace('\'', '\\\'')
files[fn] = {}
files[fn][filemd5] = md
db['files'] = files
db.close()
return md

def loaderImage(var):
fn = var.group(1)
Expand Down