Commit fec6607f authored by Nathalie Rousse's avatar Nathalie Rousse
Browse files

Comments and documentation

parent 7ffb6bae
...@@ -280,7 +280,7 @@ class ActivityLock(Lock): ...@@ -280,7 +280,7 @@ class ActivityLock(Lock):
if vpzact.id is not None : if vpzact.id is not None :
if vpzact.has_lock() : if vpzact.has_lock() :
lock = vpzact.lock_list.all()[0] # the only one lock = vpzact.lock_list.all()[0] # the only one
#if not isinstance(lock, ActivityLock) : # should be !!! #if not isinstance(lock, ActivityLock) : #...should be
if hasattr(vpzact, "vpzorigin"): if hasattr(vpzact, "vpzorigin"):
lock.lock(vpzact.vpzorigin) lock.lock(vpzact.vpzorigin)
if hasattr(vpzact, "vpzinput"): if hasattr(vpzact, "vpzinput"):
...@@ -318,7 +318,7 @@ class ActivityLock(Lock): ...@@ -318,7 +318,7 @@ class ActivityLock(Lock):
if (vpzact.id is not None) and (load_document.id is not None) : if (vpzact.id is not None) and (load_document.id is not None) :
if vpzact.has_lock() : if vpzact.has_lock() :
activity_lock = vpzact.lock_list.all()[0] # the only one activity_lock = vpzact.lock_list.all()[0] # the only one
#if not isinstance(activity_lock, ActivityLock) : #should be!!! #if not isinstance(activity_lock, ActivityLock) : #...should be
activity_user = activity_lock.get_user() activity_user = activity_lock.get_user()
load_lock = LoadLock(text=text) load_lock = LoadLock(text=text)
load_lock.save() load_lock.save()
......
...@@ -41,7 +41,7 @@ class VleRepInline(admin.TabularInline): ...@@ -41,7 +41,7 @@ class VleRepInline(admin.TabularInline):
class VleVersionAdmin(admin.ModelAdmin): class VleVersionAdmin(admin.ModelAdmin):
form = VleVersionForm form = VleVersionForm
list_display = ('id', 'name', 'verbose_name', 'usr_path',) list_display = ('id', 'name', 'verbose_name', 'usr_path',)
#actions = [generate_tree, update_tree, delete_tree] ...!!! #actions = [generate_tree, update_tree, delete_tree] ...could be added
inlines = [VleRepInline] inlines = [VleRepInline]
search_fields = ['name'] search_fields = ['name']
......
...@@ -75,13 +75,13 @@ def get_vlereppath_choices() : ...@@ -75,13 +75,13 @@ def get_vlereppath_choices() :
text = "Don't choose one of the following values, \ text = "Don't choose one of the following values, \
(existing vle packages shown only for help) :" (existing vle packages shown only for help) :"
#!! plus = [ empty_choice, ("",text) ] #plus = [ empty_choice, ("",text) ]
#!! for (path,c) in choices_list : #for (path,c) in choices_list :
#!! for pkgname in get_rep_pkgname_list(path) : # for pkgname in get_rep_pkgname_list(path) :
#!! text = c+": "+pkgname # text = c+": "+pkgname
#!! plus.append( ("",text) ) # plus.append( ("",text) )
#!! for p in plus : #for p in plus :
#!! choices_list.append(p) # choices_list.append(p)
choices_list.insert(0, empty_choice) choices_list.insert(0, empty_choice)
......
...@@ -22,21 +22,23 @@ from erecord_cmn.utils.vle import is_structured_as_vle_version_name ...@@ -22,21 +22,23 @@ from erecord_cmn.utils.vle import is_structured_as_vle_version_name
from erecord_cmn.utils.vle import is_structured_as_vle_install from erecord_cmn.utils.vle import is_structured_as_vle_install
from erecord_cmn.utils.vle import vle_bash_cmd from erecord_cmn.utils.vle import vle_bash_cmd
# !!!!!!!!!!!!! a deplacer dans traitement repository ###############################################################################
#
# Operations to record a (already physically installed)
# models repository into the database :
#
# Notes about current management and some possible improvements
# #
# Operations to record a (already physically installed) models repository into
# the database :
# #
# The models repository is recorded into the database through the following # The models repository is recorded into the database through the following
# information : its own characteristics (VleRep), the set of its vle packages # information : its own characteristics (VleRep), the set of its vle packages
# { VlePkg } and their vpz files { VleVpz }. # { VlePkg } and their vpz files { VleVpz }.
# #
# inputs : # Input information :
# - path : path of the directory where the models repository has been # - path : path of the folder where the models repository has been installed.
# installed.
# - name : name given to the models repository into the database # - name : name given to the models repository into the database
# #
# outputs (result into the database) : # Result into the database :
# - VleRep, the set of its vle packages { VlePkg } and their vpz files # - VleRep, the set of its vle packages { VlePkg } and their vpz files
# { VleVpz }. # { VleVpz }.
# #
...@@ -44,32 +46,34 @@ from erecord_cmn.utils.vle import vle_bash_cmd ...@@ -44,32 +46,34 @@ from erecord_cmn.utils.vle import vle_bash_cmd
# #
# 1) Creation of VleRep # 1) Creation of VleRep
# #
# 2) Creation of the { VlePackage } of VleRep : # 2) Creation of the { VlePkg } of VleRep :
# #
# Functions are called to define packages_list, the list of the # Definition of packages_list, the list of the existing vle packages of
# existing vle packages of VleRep ; then for each pkg in packages_list, # VleRep ; then for each pkg in packages_list, creation of VlePkg :
# creation of VlePkg :
# - VleRep = the VleRep # - VleRep = the VleRep
# - name = pkg # - name = pkg
# (- others : description, maintainer ...) # (- others : description, maintainer ...)
# #
# At this step, the local.pkg file could be used (if active) to :
# a) control packages_list (coherence between packages_list from vle
# functions and packages_list from local.pkg).
# b) define/get some information for each pkg in packages_list :
# (- depends_list : list of the vle packages that it depends on.)
# - others : description, maintainer ...
#
# 3) Creation of the { VleVpz } of the { VlePkg } of the VleRep : # 3) Creation of the { VleVpz } of the { VlePkg } of the VleRep :
# #
# For each VlePkg of the VleRep : vle functions are called to define # For each VlePkg of the VleRep : definition of vpzfiles_list, the list of
# vpzfiles_list, the list of its vpz files ; then for each vpz in # its vpz files ; then for each vpz in vpzfiles_list, creation of VleVpz :
# vpzfiles_list, creation of VleVpz :
# - VlePkg = the VlePkg # - VlePkg = the VlePkg
# - name = vpz # - name = vpz
# #
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Some possible improvements :
#
# - when treating packages_list (see 2.), the vle local.pkg file could be
# used (if active) to :
# #
# a) control packages_list (coherence between the defined/found
# packages_list and packages_list from local.pkg).
#
# b) define/get some information for each pkg in packages_list :
# (- depends_list : list of the vle packages that it depends on.)
# - others : description, maintainer ...
#
###############################################################################
# A vle version is recorded into the database through the following # A vle version is recorded into the database through the following
# information : its own characteristics (VleVersion), the set of its # information : its own characteristics (VleVersion), the set of its
...@@ -101,9 +105,9 @@ class VleVersion(DefaultVerboseNameMixin, models.Model): ...@@ -101,9 +105,9 @@ class VleVersion(DefaultVerboseNameMixin, models.Model):
usr_path = models.FilePathField(blank=False, usr_path = models.FilePathField(blank=False,
help_text=ht_vleversion_usr_path) help_text=ht_vleversion_usr_path)
#def delete_tree(self): ...!!!! #def delete_tree(self): ...could be added
#def generate_tree(self): ...!!!! #def generate_tree(self): ...could be added
#def update_tree(self): ...!!!! #def update_tree(self): ...could be added
def clean(self): def clean(self):
"""clean """ """clean """
...@@ -211,9 +215,6 @@ class VleRep(DefaultVerboseNameMixin, VleRepMixin, models.Model): ...@@ -211,9 +215,6 @@ class VleRep(DefaultVerboseNameMixin, VleRepMixin, models.Model):
"VLE_HOME directory." "VLE_HOME directory."
raise ValidationError(msg) raise ValidationError(msg)
# verifier aussi pkgs-V conforme a self.vleversion.name vle-V.rev !!!
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
"""save """ """save """
self.set_default_value_verbose_name() self.set_default_value_verbose_name()
......
...@@ -45,7 +45,6 @@ class VleRepMixin(object): ...@@ -45,7 +45,6 @@ class VleRepMixin(object):
vlepkg.vlevpz_list.create(name=vlevpzname) vlepkg.vlevpz_list.create(name=vlevpzname)
def read_and_update_tree(self) : def read_and_update_tree(self) :
pass
"""reads a VleRep tree (its vle packages and their vpz files) in its """reads a VleRep tree (its vle packages and their vpz files) in its
path and add or remove the relevant VlePkg and VleVpz into the path and add or remove the relevant VlePkg and VleVpz into the
database """ database """
......
...@@ -107,7 +107,7 @@ class VlehomeWorkspaceMixin(WorkspaceMixin): ...@@ -107,7 +107,7 @@ class VlehomeWorkspaceMixin(WorkspaceMixin):
src = vlepkgpath src = vlepkgpath
dest = os.path.join(pkgs_path,pkgname) dest = os.path.join(pkgs_path,pkgname)
if pkgname == "erecord" : # particular case !!! if pkgname == "erecord" : # particular case
shutil.copytree(src, dest) shutil.copytree(src, dest)
output_path = get_pkg_output_path(pkg_path=dest) output_path = get_pkg_output_path(pkg_path=dest)
create_dir_if_absent(dirpath=output_path) create_dir_if_absent(dirpath=output_path)
......
...@@ -329,7 +329,6 @@ def home_services( request, pk=None, format=None ): ...@@ -329,7 +329,6 @@ def home_services( request, pk=None, format=None ):
"whose id is vpzpath="+str(pk)+ " (value to be replaced by " + \ "whose id is vpzpath="+str(pk)+ " (value to be replaced by " + \
"the VpzPath id value)." "the VpzPath id value)."
#!!! a revoir !!!
titles['id'] = capital + " of the existing "+classname+" whose id " + \ titles['id'] = capital + " of the existing "+classname+" whose id " + \
"is "+str(pk)+" (value to be replaced by the "+classname+ \ "is "+str(pk)+" (value to be replaced by the "+classname+ \
" id value)." " id value)."
......
*******************************************************************************
Run vle simulation (development under ubuntu)
*******************************************************************************
"RENAME" !!!
ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
*******************************************************************************
vle-2.0.0
source /opt/erecord/erecord/install/vle_2.0.0_precmd.sh
verif : vle --version
export VLE_HOME=/work/erecord/.vle
vle -P pkgname vpzname.vpz
*******************************************************************************
vle-1.1.3
source /opt/erecord/erecord/install/vle_1.1.3_precmd.sh
verif : vle --version
*******************************************************************************
******************************************************************************* *******************************************************************************
Install development sous ubuntu
Install erecord
******************************************************************************* *******************************************************************************
Case of development under ubuntu
================================
see ubuntu/install.txt
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord "RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
General General
======= -------
The erecord project software is developed with : The erecord project software is developed with :
...@@ -37,7 +55,7 @@ Some other basic required tools : ...@@ -37,7 +55,7 @@ Some other basic required tools :
Installation of the erecordenv virtualenv Installation of the erecordenv virtualenv
========================================= -----------------------------------------
* erecordenv creation : * erecordenv creation :
virtualenv /opt/erecord/factory/install/erecordenv -p /usr/bin/python2.7 --no-site-packages virtualenv /opt/erecord/factory/install/erecordenv -p /usr/bin/python2.7 --no-site-packages
...@@ -58,7 +76,7 @@ Installation of the erecordenv virtualenv ...@@ -58,7 +76,7 @@ Installation of the erecordenv virtualenv
erecord software modifications and generations erecord software modifications and generations
============================================== ----------------------------------------------
* /opt/erecord/erecord/apps/erecord_cmn/configs/config.py : * /opt/erecord/erecord/apps/erecord_cmn/configs/config.py :
...@@ -81,12 +99,13 @@ erecord software modifications and generations ...@@ -81,12 +99,13 @@ erecord software modifications and generations
* DOC STATIC... * DOC STATIC...
INSTALL vle Install vle
=========== -----------
* INSTALL vle-2.0.0 and its dependencies, * Install vle and its dependencies, models repositories
* INSTALL vle-1.1.3 and its dependencies, (vle-1.1.3 version, vle-2.0.0 version) :
* INSTALL repositories :
see dev_install_vle.txt see install_vle.txt
*******************************************************************************
*******************************************************************************
Install vle and models repositories (vle packages)
*******************************************************************************
Case of development under ubuntu
================================
see ubuntu/install_vle.txt
*******************************************************************************
******************************************************************************* *******************************************************************************
Run erecord (development under ubuntu)
Run erecord
******************************************************************************* *******************************************************************************
"RENAME" !!! Case of development under ubuntu
ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord ================================
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
cd /opt/erecord/erecord/projects/ws cd /opt/erecord/erecord/projects/ws
* erecordenv : erecordenv
----------
#source ../../../factory/install/erecordenv/bin/activate.csh #source ../../../factory/install/erecordenv/bin/activate.csh
source ../../../factory/install/erecordenv/bin/activate source ../../../factory/install/erecordenv/bin/activate ; which python
... which python ...
* django INIT : django INIT
-----------
python manage.py makemigrations erecord_db python manage.py makemigrations erecord_db
python manage.py makemigrations erecord_acs python manage.py makemigrations erecord_acs
...@@ -26,8 +32,11 @@ cd /opt/erecord/erecord/projects/ws ...@@ -26,8 +32,11 @@ cd /opt/erecord/erecord/projects/ws
python manage.py collectstatic python manage.py collectstatic
python manage.py runserver python manage.py runserver
* django : django
------
python manage.py migrate python manage.py migrate
python manage.py runserver python manage.py runserver
*******************************************************************************
*******************************************************************************
Run vle simulation (vpzname.vpz simulator of pkgname vle package)
*******************************************************************************
(Case of development under ubuntu)
(================================)
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
Case of vle-1.1.3 version
-------------------------
source /opt/erecord/erecord/install/vle_1.1.3_precmd.sh ; vle --version
export VLE_HOME=/opt/erecord/repositories/vle-1.1.3/pkgname
vle -P pkgname vpzname.vpz
Case of vle-2.0.0 version
-------------------------
source /opt/erecord/erecord/install/vle_2.0.0_precmd.sh ; vle --version
export VLE_HOME=/opt/erecord/repositories/vle-2.0.0/pkgname
vle -P pkgname vpzname.vpz
*******************************************************************************
*******************************************************************************
Install erecord
Case of development under ubuntu
*******************************************************************************
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
General
=======
The erecord project software is developed with :
- python language (python 2.7 version),
- django framework,
- some django applications, like for example django-rest-framework.
- SQLite for databases.
- Sphinx for documentation.
Some other basic required tools :
- virtualenv
- install LibYAML version 0.1.5 :
- Download and extract the source package :
wget http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
tar -zxvf yaml-0.1.5.tar.gz
- Build and install LibYAML :
./configure
make
sudo make install
- install about libcurl :
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
Installation of the erecordenv virtualenv
=========================================
erecordenv creation
-------------------
virtualenv /opt/erecord/factory/install/erecordenv -p /usr/bin/python2.7 --no-site-packages
erecordenv virtualenv activation
--------------------------------
- in bash or sh case :
source /opt/erecord/factory/install/erecordenv/bin/activate
- in csh or tcsh case :
source /opt/erecord/factory/install/erecordenv/bin/activate.csh
- just to control the activation on the erecordenv virtualenv :
which python
- installation from requirement.txt :
pip install -r /opt/erecord/erecord/install/requirement.txt
erecord software modifications and generations
==============================================
/opt/erecord/erecord/apps/erecord_cmn/configs/config.py
-------------------------------------------------------
IN_PRODUCTION = False
ONLINEDOC_URL = 'http://erecord.toulouse.inra.fr/docs.html' ...?
/opt/erecord/erecord/projects/ws/ws/settings.py
-----------------------------------------------
DEBUG = True
/opt/erecord/docs/source/devel/design/webapi/include/online_url.rst and
/opt/erecord/docs/source/devel/design/webapi/include/online_*.rst
-----------------------------------------------------------------
Put the appropriate url value : http://erecord.toulouse.inra.fr:8000 ...?
(commands, if '127.0.0.1' has to be replaced by 'erecord.toulouse.inra.fr' into online_*.rst files :
cd /home/erecord/save/opt/erecord/docs/source/devel/design/webapi/include ;
sed -i 's/127.0.0.1/erecord.toulouse.inra.fr/g' online_url*.rst ; )
DOC STATIC
----------
............
Install vle
===========
Install vle and its dependencies, models repositories (vle-X.a.b versions)
--------------------------------------------------------------------------
see install_vle.txt
*******************************************************************************
*******************************************************************************
Install vle and models repositories (vle packages)
Case of development under ubuntu
*******************************************************************************
"RENAME" : ln -s /home/nrousse/workspace_git/DEVELOPPEMENT_WEB/recordweb/vle-x/trunk/erecord /opt/erecord
*******************************************************************************
Install vle
Case of development under ubuntu
*******************************************************************************
Case of vle-1.1.3 version
=========================
see install_vle_1.1.3.txt
Case of vle-2.0.0 version
=========================
see install_vle_2.0.0.txt
*******************************************************************************