Commit cda2a21e authored by Administrator's avatar Administrator

[DOC] Doc for functions.

parent af65fed3
......@@ -4,7 +4,9 @@ import linecache
from gargantext_web.settings import MEDIA_ROOT
def ensure_dir(user):
# If user is new, folder does not exist yet, create it then
'''
If user is new, folder does not exist yet, create it then
'''
dirpath = '%s/corpora/%s' % (MEDIA_ROOT, user.username)
if not os.path.exists(dirpath):
print("Creating folder %s" % dirpath)
......@@ -12,6 +14,12 @@ def ensure_dir(user):
def PrintException():
'''
This function has to be used in except part to print error with:
- the file
- the line number
- an explicit error araising
'''
exc_type, exc_obj, tb = sys.exc_info()
f = tb.tb_frame
lineno = tb.tb_lineno
......
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