Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
smartpublicbuilding
openhab-pb-stack
Commits
e014da83
Commit
e014da83
authored
Jan 09, 2019
by
dobli
Browse files
add folds for vim
parent
a2dd6d05
Changes
1
Hide whitespace changes
Inline
Side-by-side
building_manager.py
View file @
e014da83
...
...
@@ -11,7 +11,7 @@ CONFIG_DIRS = [
# ******************************
# Config file functions
# Config file functions
{{{
# ******************************
def
generate_config_folders
(
base_path
):
"""Generate folders for configuration files
...
...
@@ -24,8 +24,11 @@ def generate_config_folders(base_path):
os
.
makedirs
(
new_dir
)
# }}}
# ******************************
# Docker machine functions
# Docker machine functions
{{{
# ******************************
def
get_machine_list
():
"""Get a list of docker machine names using the docker-machine system command
...
...
@@ -43,7 +46,7 @@ def check_machine_exists(machine_name):
"""Checks weather a docker machine exists and is available
:machine_name: Name of the machine to check
:returns: T
ODO
:returns: T
rue when machine is available
"""
machines
=
get_machine_list
()
...
...
@@ -72,8 +75,11 @@ def get_machine_env(machine_name):
return
machine_envs
# }}}
# ******************************
# Docker client commands
# Docker client commands
{{{
# ******************************
def
assign_label_to_node
(
nodeid
,
label
,
value
):
"""Assigns a label to a node (e.g. building)
...
...
@@ -128,8 +134,11 @@ def run_command_in_service(service, command, building=None):
client
.
close
()
# }}}
# ******************************
# CLI base commands
and main
# CLI base commands
{{{
# ******************************
def
init_config_dirs_command
(
args
):
"""Initialize config directories
...
...
@@ -198,8 +207,11 @@ def interactive_command(args):
print
(
main_menu
())
# }}}
# ******************************
# Interactive menu entries
# Interactive menu entries
{{{
# ******************************
def
main_menu
():
""" Display main menu
...
...
@@ -244,8 +256,10 @@ def init_menu():
print
(
answers
)
# }}}
# ******************************
# Script main (entry)
# Script main (entry)
{{{
# ******************************
if
__name__
==
'__main__'
:
import
argparse
...
...
@@ -307,3 +321,7 @@ if __name__ == '__main__':
args
=
parser
.
parse_args
()
args
.
func
(
args
)
# }}}
# --- vim settings ---
# vim:foldmethod=marker:foldlevel=0
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment