Commits

Alessio Deiana committed 667bb57

Handles copy of bfo, bfe and bibformat elements

Comments (0)

Files changed (2)

src/invenio_devserver/config.py

     'js': 'var/www/js',
     'css': 'var/www/css',
     'conf': 'etc',
+    'bft': 'etc/bibformat/format_templates',
+    'bfo': 'etc/bibformat/output_formats',
 }
 
 STATIC_FILES = {

src/invenio_devserver/serve.py

 import socket
 import traceback
 import logging
+import re
 from itertools import chain
 
 try:
     # Python 2.4 compatibility
     BaseException = Exception
 
+
 DESCRIPTION = "Invenio web server for development"
 USAGE_MESSAGE = "python serve.py [-bp]"
+RE_BIBFORMAT_ELEMENTS = re.compile(u"^/modules/bibformat/lib/elements/.*\.py",
+                                   re.U|re.I)
 
 
 def get_extension(filename):
 def select_destination_path(filename, install_path=config.INSTALL_PATH,
                                                             dests=config.DIRS):
     dest = None
-    lib_dir = dests[get_extension(filename)]
+
+    rel_path = filename
+    for src_path in config.SRC_PATH:
+        if rel_path.startswith(src_path):
+            rel_path = rel_path.replace(src_path, '')
+            break
+
+    ext = get_extension(filename)
+    lib_dir = dests[ext]
     if lib_dir:
+        if ext == 'py':
+            if RE_BIBFORMAT_ELEMENTS.match(rel_path):
+                lib_dir = os.path.join(lib_dir, 'bibformat_elements')
         dest = os.path.join(install_path,
                             lib_dir,
                             os.path.basename(filename))