From 696a47b29b0f6a9cabc3a8aa015c473e5c6e747a Mon Sep 17 00:00:00 2001
From: Fawzi Mohamed <fawzi.mohamed@fhi-berlin.mpg.de>
Date: Wed, 13 Jan 2016 00:16:48 +0100
Subject: [PATCH] cleaner handling of python-common in resources

python -> common/python to avoid spurious files, and better naming in
scala resources, minor fixes
---
 README.md                                     | 24 +++++++++++++++++--
 .../python}/nomadcore/ActivateLogging.py      |  0
 .../python}/nomadcore/__init__.py             |  0
 .../python}/nomadcore/basic_meta_info.py      |  0
 .../python}/nomadcore/caching_backend.py      |  0
 .../python}/nomadcore/compact_sha.py          |  0
 .../python}/nomadcore/coordinate_reader.py    |  0
 .../python}/nomadcore/json_support.py         |  0
 .../python}/nomadcore/local_meta_info.py      |  0
 .../python}/nomadcore/model_archive.py        |  0
 .../python}/nomadcore/model_base.py           |  0
 .../python}/nomadcore/model_meta_info.py      |  0
 .../python}/nomadcore/parse_streamed_dicts.py |  0
 .../python}/nomadcore/parser_backend.py       |  0
 .../python}/nomadcore/simple_parser.py        |  0
 .../nomadcore/unit_conversion/__init__.py     |  0
 .../nomadcore/unit_conversion/constants.txt   |  0
 .../unit_conversion/unit_conversion.py        |  0
 .../nomadcore/unit_conversion/units.txt       |  0
 {python => common/python}/nomadcore/utils.py  |  0
 .../python}/nomadscripts/__init__.py          |  0
 .../calculate_meta_info_overrides.py          |  4 ++--
 .../python}/nomadscripts/load_meta_info.py    |  0
 .../nomadscripts/normalize_meta_info.py       |  2 +-
 24 files changed, 25 insertions(+), 5 deletions(-)
 rename {python => common/python}/nomadcore/ActivateLogging.py (100%)
 rename {python => common/python}/nomadcore/__init__.py (100%)
 rename {python => common/python}/nomadcore/basic_meta_info.py (100%)
 rename {python => common/python}/nomadcore/caching_backend.py (100%)
 rename {python => common/python}/nomadcore/compact_sha.py (100%)
 rename {python => common/python}/nomadcore/coordinate_reader.py (100%)
 rename {python => common/python}/nomadcore/json_support.py (100%)
 rename {python => common/python}/nomadcore/local_meta_info.py (100%)
 rename {python => common/python}/nomadcore/model_archive.py (100%)
 rename {python => common/python}/nomadcore/model_base.py (100%)
 rename {python => common/python}/nomadcore/model_meta_info.py (100%)
 rename {python => common/python}/nomadcore/parse_streamed_dicts.py (100%)
 rename {python => common/python}/nomadcore/parser_backend.py (100%)
 rename {python => common/python}/nomadcore/simple_parser.py (100%)
 rename {python => common/python}/nomadcore/unit_conversion/__init__.py (100%)
 rename {python => common/python}/nomadcore/unit_conversion/constants.txt (100%)
 rename {python => common/python}/nomadcore/unit_conversion/unit_conversion.py (100%)
 rename {python => common/python}/nomadcore/unit_conversion/units.txt (100%)
 rename {python => common/python}/nomadcore/utils.py (100%)
 rename {python => common/python}/nomadscripts/__init__.py (100%)
 rename {python => common/python}/nomadscripts/calculate_meta_info_overrides.py (98%)
 rename {python => common/python}/nomadscripts/load_meta_info.py (100%)
 rename {python => common/python}/nomadscripts/normalize_meta_info.py (99%)

diff --git a/README.md b/README.md
index 523fcff..5a1b4ce 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,27 @@
 # __python-common__
-This repository contains the common components for building a parser for the NOMAD project. The following instructions were tested on Ubuntu 14.04.
+
+
+This repository contains the common python files that are
+part of the [NOMAD Laboratory](http://nomad-lab.eu).
+The official version lives at
+
+    git@gitlab.mpcdf.mpg.de:nomad-lab/python-common.git
+
+you can browse it at
+
+    https://gitlab.mpcdf.mpg.de/nomad-lab/python-common
+
+Some things rely on having the nomad-meta-info checked out at the same level.
+The simplest way to have this is to check out nomad-lab-base recursively:
+
+    git clone --recursive git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git
+
+then this will be in python-common within it.
 
 # Quick Install
+
+The following instructions were tested on Ubuntu 14.04.
+
 The modules used for parser development are located under the 'nomadcore' package. You can setup this package in any way you like, but a simple installation script 'setup.py' is provided for ease of use. It will install the nomadcore package along with the needed dependencies. You can install the package in development mode by calling the terminal command
 
 ```sh
@@ -40,4 +60,4 @@ or the addition can be made permanent by adding the line
 export PYTHONPATH="${PYTHONPATH}:/path/to/python-common/python"
 ```
 
-to your ~/.bashrc file.
\ No newline at end of file
+to your ~/.bashrc file.
diff --git a/python/nomadcore/ActivateLogging.py b/common/python/nomadcore/ActivateLogging.py
similarity index 100%
rename from python/nomadcore/ActivateLogging.py
rename to common/python/nomadcore/ActivateLogging.py
diff --git a/python/nomadcore/__init__.py b/common/python/nomadcore/__init__.py
similarity index 100%
rename from python/nomadcore/__init__.py
rename to common/python/nomadcore/__init__.py
diff --git a/python/nomadcore/basic_meta_info.py b/common/python/nomadcore/basic_meta_info.py
similarity index 100%
rename from python/nomadcore/basic_meta_info.py
rename to common/python/nomadcore/basic_meta_info.py
diff --git a/python/nomadcore/caching_backend.py b/common/python/nomadcore/caching_backend.py
similarity index 100%
rename from python/nomadcore/caching_backend.py
rename to common/python/nomadcore/caching_backend.py
diff --git a/python/nomadcore/compact_sha.py b/common/python/nomadcore/compact_sha.py
similarity index 100%
rename from python/nomadcore/compact_sha.py
rename to common/python/nomadcore/compact_sha.py
diff --git a/python/nomadcore/coordinate_reader.py b/common/python/nomadcore/coordinate_reader.py
similarity index 100%
rename from python/nomadcore/coordinate_reader.py
rename to common/python/nomadcore/coordinate_reader.py
diff --git a/python/nomadcore/json_support.py b/common/python/nomadcore/json_support.py
similarity index 100%
rename from python/nomadcore/json_support.py
rename to common/python/nomadcore/json_support.py
diff --git a/python/nomadcore/local_meta_info.py b/common/python/nomadcore/local_meta_info.py
similarity index 100%
rename from python/nomadcore/local_meta_info.py
rename to common/python/nomadcore/local_meta_info.py
diff --git a/python/nomadcore/model_archive.py b/common/python/nomadcore/model_archive.py
similarity index 100%
rename from python/nomadcore/model_archive.py
rename to common/python/nomadcore/model_archive.py
diff --git a/python/nomadcore/model_base.py b/common/python/nomadcore/model_base.py
similarity index 100%
rename from python/nomadcore/model_base.py
rename to common/python/nomadcore/model_base.py
diff --git a/python/nomadcore/model_meta_info.py b/common/python/nomadcore/model_meta_info.py
similarity index 100%
rename from python/nomadcore/model_meta_info.py
rename to common/python/nomadcore/model_meta_info.py
diff --git a/python/nomadcore/parse_streamed_dicts.py b/common/python/nomadcore/parse_streamed_dicts.py
similarity index 100%
rename from python/nomadcore/parse_streamed_dicts.py
rename to common/python/nomadcore/parse_streamed_dicts.py
diff --git a/python/nomadcore/parser_backend.py b/common/python/nomadcore/parser_backend.py
similarity index 100%
rename from python/nomadcore/parser_backend.py
rename to common/python/nomadcore/parser_backend.py
diff --git a/python/nomadcore/simple_parser.py b/common/python/nomadcore/simple_parser.py
similarity index 100%
rename from python/nomadcore/simple_parser.py
rename to common/python/nomadcore/simple_parser.py
diff --git a/python/nomadcore/unit_conversion/__init__.py b/common/python/nomadcore/unit_conversion/__init__.py
similarity index 100%
rename from python/nomadcore/unit_conversion/__init__.py
rename to common/python/nomadcore/unit_conversion/__init__.py
diff --git a/python/nomadcore/unit_conversion/constants.txt b/common/python/nomadcore/unit_conversion/constants.txt
similarity index 100%
rename from python/nomadcore/unit_conversion/constants.txt
rename to common/python/nomadcore/unit_conversion/constants.txt
diff --git a/python/nomadcore/unit_conversion/unit_conversion.py b/common/python/nomadcore/unit_conversion/unit_conversion.py
similarity index 100%
rename from python/nomadcore/unit_conversion/unit_conversion.py
rename to common/python/nomadcore/unit_conversion/unit_conversion.py
diff --git a/python/nomadcore/unit_conversion/units.txt b/common/python/nomadcore/unit_conversion/units.txt
similarity index 100%
rename from python/nomadcore/unit_conversion/units.txt
rename to common/python/nomadcore/unit_conversion/units.txt
diff --git a/python/nomadcore/utils.py b/common/python/nomadcore/utils.py
similarity index 100%
rename from python/nomadcore/utils.py
rename to common/python/nomadcore/utils.py
diff --git a/python/nomadscripts/__init__.py b/common/python/nomadscripts/__init__.py
similarity index 100%
rename from python/nomadscripts/__init__.py
rename to common/python/nomadscripts/__init__.py
diff --git a/python/nomadscripts/calculate_meta_info_overrides.py b/common/python/nomadscripts/calculate_meta_info_overrides.py
similarity index 98%
rename from python/nomadscripts/calculate_meta_info_overrides.py
rename to common/python/nomadscripts/calculate_meta_info_overrides.py
index 3881f78..5d71feb 100644
--- a/python/nomadscripts/calculate_meta_info_overrides.py
+++ b/common/python/nomadscripts/calculate_meta_info_overrides.py
@@ -216,8 +216,8 @@ def buildOverrides(oldValues, newValues):
 
 
 if __name__ == "__main__":
-    overridesDir = os.path.normpath(os.path.join(basePath,"../nomad_meta_info_overrides"))
-    defaultPath = os.path.normpath(os.path.join(basePath,"../nomad_meta_info"))
+    overridesDir = os.path.normpath(os.path.join(basePath,"../../../nomad-meta-info/meta_info/nomad_meta_info_overrides"))
+    defaultPath = os.path.normpath(os.path.join(basePath,"../../../nomad-meta-info/meta_info/nomad_meta_info"))
     usage = """usage: {command} [--check-only] [--old-ref <ref1=HEAD>] [--old-path <path=None>] [--help]
     [--new-ref <ref2=None>] [--new-path <path=basePath>] [--repo-path <repoPath=None>]
     [--overrides-dir <overridesDir>] [--no-clobber] [--verbose] [<basePath>]
diff --git a/python/nomadscripts/load_meta_info.py b/common/python/nomadscripts/load_meta_info.py
similarity index 100%
rename from python/nomadscripts/load_meta_info.py
rename to common/python/nomadscripts/load_meta_info.py
diff --git a/python/nomadscripts/normalize_meta_info.py b/common/python/nomadscripts/normalize_meta_info.py
similarity index 99%
rename from python/nomadscripts/normalize_meta_info.py
rename to common/python/nomadscripts/normalize_meta_info.py
index 41009ec..9dd29dd 100755
--- a/python/nomadscripts/normalize_meta_info.py
+++ b/common/python/nomadscripts/normalize_meta_info.py
@@ -184,7 +184,7 @@ def normalizePaths(paths, checkOnly, force, addGid, addSubGids, extraArgsHandlin
     return {"paths": paths, "hasErrors": hasErrors, "hasChanges": hasChanges}
 
 if __name__ == "__main__":
-    defaultDir = os.path.normpath(os.path.join(basePath, "../../nomad-meta-info/meta_info/nomad_meta_info"))
+    defaultDir = os.path.normpath(os.path.join(basePath, "../../../nomad-meta-info/meta_info/nomad_meta_info"))
     usage = """usage: {command} [--check-only] [--force] [--add-gid] [--add-sub-gids] [--keep-extra-args] [--remove-extra-args] [--error-if-extra-args] [file/or/dir ...]
 
     normalizes the InfoKinds file/or/dir (that defalts to {dir})
-- 
GitLab