Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.backend.python
Commits
b1740736
Commit
b1740736
authored
Mar 17, 2017
by
Philip ABBET
Browse files
More fixes
parent
aa4eff11
Changes
2
Hide whitespace changes
Inline
Side-by-side
beat/backend/python/hash.py
View file @
b1740736
...
...
@@ -30,6 +30,10 @@
import
hashlib
import
simplejson
import
collections
import
copy
import
six
def
_sha256
(
s
):
...
...
beat/backend/python/utils.py
View file @
b1740736
...
...
@@ -253,7 +253,13 @@ class CodeStorage(object):
def
save
(
self
,
declaration
,
code
=
None
,
description
=
None
):
"""Saves the JSON declaration and the code as files"""
super
(
CodeStorage
,
self
).
save
(
declaration
,
description
)
if
description
:
self
.
doc
.
save
(
description
.
encode
(
'utf8'
))
if
not
isinstance
(
declaration
,
six
.
string_types
):
declaration
=
simplejson
.
dumps
(
declaration
,
indent
=
4
)
self
.
json
.
save
(
declaration
)
if
code
:
if
self
.
_language
==
'unknown'
:
self
.
language
=
self
.
__auto_discover_language
(
declaration
)
...
...
@@ -261,5 +267,6 @@ class CodeStorage(object):
def
remove
(
self
):
"""Removes the object from the disk"""
super
(
CodeStorage
,
self
).
remove
()
self
.
json
.
remove
()
self
.
doc
.
remove
()
self
.
code
.
remove
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment