Commit 52470e1d authored by Philip ABBET's avatar Philip ABBET

Reformatting

parent 548211ce
......@@ -6,7 +6,7 @@
# Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.core module of the BEAT platform. #
# This file is part of the beat.backend.python module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
......@@ -51,6 +51,8 @@ def hashed_or_simple(prefix, what, path, suffix='.json'):
return os.path.join(prefix, what, path)
#----------------------------------------------------------
def safe_rmfile(f):
"""Safely removes a file from the disk"""
......@@ -58,6 +60,8 @@ def safe_rmfile(f):
if os.path.exists(f): os.unlink(f)
#----------------------------------------------------------
def safe_rmdir(f):
"""Safely removes the directory containg a given file from the disk"""
......@@ -67,6 +71,8 @@ def safe_rmdir(f):
if not os.listdir(d): os.rmdir(d)
#----------------------------------------------------------
def extension_for_language(language):
"""Returns the preferred extension for a given programming language
......@@ -99,6 +105,8 @@ def extension_for_language(language):
)[language]
#----------------------------------------------------------
class File(object):
"""User helper to read and write file objects"""
......@@ -154,6 +162,8 @@ class File(object):
safe_rmdir(self.path) #remove containing directory
#----------------------------------------------------------
class Storage(object):
"""Resolves paths for objects that provide only a description
......@@ -199,6 +209,8 @@ class Storage(object):
self.doc.remove()
#----------------------------------------------------------
class CodeStorage(object):
"""Resolves paths for objects that provide a description and code
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment