diff --git a/.clang-format b/cpp/.clang-format similarity index 100% rename from .clang-format rename to cpp/.clang-format diff --git a/cpp/template-file.cpp b/cpp/template-file.cpp new file mode 100644 index 0000000..e478364 --- /dev/null +++ b/cpp/template-file.cpp @@ -0,0 +1,24 @@ +/** + * @file template-file.h + * @brief File containing example of doxygen usage for quick reference. + * + * Here typically goes a more extensive explanation of what the header defines. + * + * @author Name + * @copyright (c) Company Name/ Author, YEAR + * @copyright Licensed under the Apache License, Version 2.0 + * @copyright Licensed under the GNU GPLv3 License + */ + +// include system headers here + +// then include more specific library headers + +// include local headers last + +/** + * The implementation specific explanation might also be added to the source file. + */ +int add(int a, int b) { + return a + b; +} diff --git a/cpp/template-file.h b/cpp/template-file.h new file mode 100644 index 0000000..88f6a7a --- /dev/null +++ b/cpp/template-file.h @@ -0,0 +1,43 @@ +/** + * @file template-file.h + * @brief File containing example of doxygen usage for quick reference. + * + * Here typically goes a more extensive explanation of what the header defines. + * + * @author Name + * @copyright (c) Company Name/ Author, YEAR + * @copyright Licensed under the Apache License, Version 2.0 + * @copyright Licensed under the GNU GPLv3 License + */ + +#ifndef _TEMPLATE_FILE_H +#define _TEMPLATE_FILE_H + +// include system headers here + +// then include more specific library headers + +// include local headers last + +/** + * @brief Use brief, otherwise the index won't have a brief explanation. + * + * Detailed explanation. + */ +typedef enum BoxEnum_enum { + BOXENUM_FIRST, /**< Some documentation for first. */ + BOXENUM_SECOND, /**< Some documentation for second. */ + BOXENUM_ETC /**< Etc. */ +} BoxEnum; + +/** + * @brief This method adds two integers. + * + * Detailed explanation. + * @param a First integer to add. + * @param b Second integer to add. + * @return The sum of both parameters. + */ +int add(int a, int b); + +#endif /* _TEMPLATE_FILE_H */ diff --git a/file-cpp.h b/file-cpp.h deleted file mode 100644 index 3962d74..0000000 --- a/file-cpp.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * $name library - * $description - * for $description - * - * copyright: Jannik Beyerstedt - * license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License - */ - -// TODO: better license text!!! diff --git a/file-css.css b/html-css/template-file.css similarity index 82% rename from file-css.css rename to html-css/template-file.css index 1e5a09f..0a5a541 100644 --- a/file-css.css +++ b/html-css/template-file.css @@ -13,10 +13,3 @@ * HELPERS */ /* CSS HERE */ - - - -/* - * KIRBYTAGS - */ -/* CSS HERE */ diff --git a/.pep8 b/python/.pep8 similarity index 100% rename from .pep8 rename to python/.pep8 diff --git a/pylintrc b/python/pylintrc similarity index 100% rename from pylintrc rename to python/pylintrc diff --git a/python/template-main.py b/python/template-main.py new file mode 100644 index 0000000..2fd8a3e --- /dev/null +++ b/python/template-main.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +""" +Project - Application Title + +TODO: Add a short explanation of the application here. +""" + +import argparse +import logging + + +if __name__ == "__main__": + log_format = '%(asctime)s %(levelname)s:%(name)s: %(message)s' + log_datefmt = '%Y-%m-%dT%H:%M:%S%z' + logging.basicConfig(format=log_format, datefmt=log_datefmt, level=logging.INFO) + logger = logging.getLogger() + + parser = argparse.ArgumentParser(description='TODO Program Title') + parser.add_argument('-n', '--dryrun', action='store_true', + help='do not connect to the FMU') + parser.add_argument("-v", "--verbosity", action="count", + help="increase output and logging verbosity") + args = parser.parse_args() + + if args.verbosity == 2: + logger.setLevel(logging.DEBUG) + elif args.verbosity == 1: + logger.setLevel(logging.INFO) + else: + logger.setLevel(logging.WARNING) diff --git a/python/template-module.py b/python/template-module.py new file mode 100644 index 0000000..3ef9ee6 --- /dev/null +++ b/python/template-module.py @@ -0,0 +1,48 @@ +""" +TODO This is just an example of a module docstring. Explain what this module +does at this place. +""" + +import logging + +LOGGER = logging.getLogger(__name__) + + +class MyClass: + """ + Put a short explanation of this class here. + + Attributes: + public_param: Some publicly accessible parameter + """ + + _private_param: str + public_param: int + + def __init__(self, param1): + """ + The constructor for MyClass. + + Parameters: + param1: Description of param1 + """ + _private_param = param1 + + +def my_function(param1: int) -> int: + """ + Summary line. + + Extended description of function. + + Parameters: + param1: Description of param1 + + Returns: + Description of return value + """ + return param1 * 5 + + +if __name__ == "__main__": + LOGGER.error("do not run this on it's own")