[DEV] add basic documentation in the action parts

This commit is contained in:
Edouard DUPIN 2019-07-30 23:36:00 +02:00
parent 3e432ffc21
commit 00b2544511
12 changed files with 253 additions and 46 deletions

View File

@ -18,17 +18,35 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Ckeckout a specific branch in all repository" return "Ckeckout a specific branch in all repository"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("r", "remote", haveParam=True, desc="Name of the remote server") my_args.add("r", "remote", haveParam=True, desc="Name of the remote server")
my_args.add_arg("branch", optionnal=False, desc="Branch to checkout") my_args.add_arg("branch", optionnal=False, desc="Branch to checkout")
def execute(arguments): ##
## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_remote_name = "" argument_remote_name = ""
branch_to_checkout = "" branch_to_checkout = ""
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "remote": if elem.get_option_name() == "remote":
debug.info("find remote name: '" + elem.get_arg() + "'") debug.info("find remote name: '" + elem.get_arg() + "'")
argument_remote_name = elem.get_arg() argument_remote_name = elem.get_arg()

View File

@ -18,15 +18,32 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Write the command you want to be executed in every repository" return "Write the command you want to be executed in every repository"
##
## @brief Set the option argument are not able to check if the argument are correct or not
## @return (boolean) have parameter without arguments
##
def have_unknow_argument(): def have_unknow_argument():
return True return True
def execute(arguments): ##
## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
cmd = "" cmd = ""
for elem in arguments: for elem in _arguments:
debug.info("Get data element: " + str(elem.get_arg())) debug.info("Get data element: " + str(elem.get_arg()))
cmd += elem.get_arg() + " " cmd += elem.get_arg() + " "

View File

@ -18,23 +18,37 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Commit in all repository" return "Commit in all repository"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("m", "message", haveParam=True, desc="Message to commit data") my_args.add("m", "message", haveParam=True, desc="Message to commit data")
my_args.add("a", "all", desc="Commit all elements") my_args.add("a", "all", desc="Commit all elements")
my_args.add("", "amend", desc="Ammend data at the previous commit") my_args.add("", "amend", desc="Ammend data at the previous commit")
##
def execute(arguments): ## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_message = "" argument_message = ""
argument_amend = "" argument_amend = ""
argument_all = "" argument_all = ""
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "message": if elem.get_option_name() == "message":
debug.info("find message: '" + elem.get_arg() + "'") debug.info("find message: '" + elem.get_arg() + "'")
argument_message = " --message \"" + elem.get_arg() + "\" "; argument_message = " --message \"" + elem.get_arg() + "\" ";

View File

@ -17,16 +17,33 @@ from island import manifest
from island import commands from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Push a delover (develop & master & tag) on the remotre server" return "Push a delover (develop & master & tag) on the remotre server"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("r", "remote", haveParam=True, desc="Name of the remote server") my_args.add("r", "remote", haveParam=True, desc="Name of the remote server")
##
def execute(arguments): ## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_remote_name = "" argument_remote_name = ""
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "remote": if elem.get_option_name() == "remote":
debug.info("find remote name: '" + elem.get_arg() + "'") debug.info("find remote name: '" + elem.get_arg() + "'")
argument_remote_name = elem.get_arg() argument_remote_name = elem.get_arg()

View File

@ -18,19 +18,36 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Deliver the current repository (develop & master MUST be up to date and you MUST be on master)" return "Deliver the current repository (develop & master MUST be up to date and you MUST be on master)"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(_my_args, _section): def add_specific_arguments(_my_args, _section):
pass pass
default_behind_message = "[DEV] update dev tag version" default_behind_message = "[DEV] update dev tag version"
default_update_message = "[VERSION] update dev tag version" default_update_message = "[VERSION] update dev tag version"
def execute(arguments): ##
## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_remote_name = "" argument_remote_name = ""
for elem in arguments: for elem in _arguments:
debug.error("Wrong argument: '" + elem.get_option_name() + "' '" + elem.get_arg() + "'") debug.error("Wrong argument: '" + elem.get_option_name() + "' '" + elem.get_arg() + "'")
# check if .XXX exist (create it if needed) # check if .XXX exist (create it if needed)

View File

@ -18,15 +18,33 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Fecth all the repository (get all modification on the server)" return "Fecth all the repository (get all modification on the server)"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("r", "remote", haveParam=True, desc="Name of the remote server") my_args.add("r", "remote", haveParam=True, desc="Name of the remote server")
def execute(arguments): ##
## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_remote_name = "" argument_remote_name = ""
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "remote": if elem.get_option_name() == "remote":
debug.info("find remote name: '" + elem.get_arg() + "'") debug.info("find remote name: '" + elem.get_arg() + "'")
argument_remote_name = elem.get_arg() argument_remote_name = elem.get_arg()

View File

@ -16,23 +16,40 @@ from island import commands
from island import multiprocess from island import multiprocess
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Init a island repository (need 'fetch' after)" return "Init a island repository (need 'fetch' after)"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("b", "branch", haveParam=True, desc="Select branch to display") my_args.add("b", "branch", haveParam=True, desc="Select branch to display")
my_args.add("m", "manifest", haveParam=True, desc="Name of the manifest") my_args.add("m", "manifest", haveParam=True, desc="Name of the manifest")
##
def execute(arguments): ## @brief Execute the action required.
if len(arguments) == 0: ##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
if len(_arguments) == 0:
debug.error("Missing argument to execute the current action ...") debug.error("Missing argument to execute the current action ...")
# the configuration availlable: # the configuration availlable:
branch = "master" branch = "master"
manifest_name = "default.xml" manifest_name = "default.xml"
address_manifest = "" address_manifest = ""
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "branch": if elem.get_option_name() == "branch":
debug.info("find branch name: '" + elem.get_arg() + "'") debug.info("find branch name: '" + elem.get_arg() + "'")
branch = elem.get_arg() branch = elem.get_arg()

View File

@ -18,15 +18,32 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Syncronize all the repository referenced" return "Syncronize all the repository referenced"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
pass pass
def execute(arguments): ##
for elem in arguments: ## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
for elem in _arguments:
debug.error("pull Wrong argument: '" + elem.get_option_name() + "' '" + elem.get_arg() + "'") debug.error("pull Wrong argument: '" + elem.get_option_name() + "' '" + elem.get_arg() + "'")
# check if .XXX exist (create it if needed) # check if .XXX exist (create it if needed)

View File

@ -18,19 +18,33 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Push all repository to the upper server" return "Push all repository to the upper server"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("r", "remote", haveParam=True, desc="Name of the remote server") my_args.add("r", "remote", haveParam=True, desc="Name of the remote server")
##
def execute(arguments): ## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_remote_name = "" argument_remote_name = ""
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "remote": if elem.get_option_name() == "remote":
debug.info("find remote name: '" + elem.get_arg() + "'") debug.info("find remote name: '" + elem.get_arg() + "'")
argument_remote_name = elem.get_arg() argument_remote_name = elem.get_arg()

View File

@ -18,20 +18,36 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Get the status of all the repositories" return "Get the status of all the repositories"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(_my_args, _section): def add_specific_arguments(_my_args, _section):
_my_args.add("r", "remote", haveParam=True, desc="Name of the remote server") _my_args.add("r", "remote", haveParam=True, desc="Name of the remote server")
_my_args.add("t", "tags", haveParam=False, desc="Display if the commit is on a tag (and display it)") _my_args.add("t", "tags", haveParam=False, desc="Display if the commit is on a tag (and display it)")
##
def execute(arguments): ## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
argument_remote_name = "" argument_remote_name = ""
argument_display_tag = False argument_display_tag = False
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "remote": if elem.get_option_name() == "remote":
debug.info("find remote name: '" + elem.get_arg() + "'") debug.info("find remote name: '" + elem.get_arg() + "'")
argument_remote_name = elem.get_arg() argument_remote_name = elem.get_arg()

View File

@ -18,19 +18,38 @@ from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Update all the branche to the trackin branch in local (no remote access)" return "Update all the branche to the trackin branch in local (no remote access)"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
#my_args.add("d", "download", haveParam=False, desc="Just download the 'not download' repository") my_args.add("r", "reset", haveParam=False, desc="Rebase the repository instead of 'reset --hard'")
pass
def execute(arguments): ##
for elem in arguments: ## @brief Execute the action required.
"""if elem.get_option_name() == "download": ##
just_download = True ## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
debug.info("find remote name: '" + elem.get_arg() + "'") ## None : No error (return program out 0)
## -5 : env.ret_manifest_is_not_existing : Manifest does not exit
## -10 : env.ret_action_is_not_existing : ACTION is not existing
## -11 : env.ret_action_executing_system_error : ACTION execution system error
## -12 : env.ret_action_wrong_parameters : ACTION Wrong parameters
## -13 : env.ret_action_partial_done : ACTION partially done
##
def execute(_arguments):
reset_instead_of_rebase = False
for elem in _arguments:
if elem.get_option_name() == "rebase":
reset_instead_of_rebase = True
debug.info("==> Request reset instead of rebase")
else: else:
""" """

View File

@ -17,17 +17,40 @@ from island import manifest
from island import commands from island import commands
import os import os
##
## @brief Get the global description of the current action
## @return (string) the description string (fist line if reserved for the overview, all is for the specific display)
##
def help(): def help():
return "Syncronize all the repository referenced" return "Syncronize all the repository referenced"
##
## @brief at the end of the help wa have the example section
## @return (string) the Example description string
##
def help_example():
return "island init https://git.heeroyui.org/atria-tools/island.git"
##
## @brief Add argument to the specific action
## @param[in,out] my_args (death.Arguments) Argument manager
## @param[in] section Name of the currect action
##
def add_specific_arguments(my_args, section): def add_specific_arguments(my_args, section):
my_args.add("d", "download", haveParam=False, desc="Just download the 'not download' repository") my_args.add("d", "download", haveParam=False, desc="Just download the 'not download' repository")
def execute(arguments): ##
## @brief Execute the action required.
##
## @return error value [0 .. 50] the <0 value is reserved system ==> else, what you want.
## None : No error (return program out 0)
## -10 : ACTION is not existing
## -11 : ACTION execution system error
## -12 : ACTION Wrong parameters
##
def execute(_arguments):
just_download = False just_download = False
for elem in arguments: for elem in _arguments:
if elem.get_option_name() == "download": if elem.get_option_name() == "download":
just_download = True just_download = True
debug.info("find remote name: '" + elem.get_arg() + "'") debug.info("find remote name: '" + elem.get_arg() + "'")