filestrings#

class filestrings.CLIFileStrings[source]#

Bases: object

contains all cli filestrings except config.h which is read from the lib root/src/config and regenerated

Args:

object (object): base object specialization

cli_h_fs = '\n#if !defined(__CLI_SETUP__)\n    #define __CLI_SETUP__\n    #include "InputHandler.h"{arduino_compatibility}\n    #include "functions.h"\n    #include "parameters.h"\n\n{outputbuffer}\nconst PROGMEM ih::ProcessName process_name = "{processname}"; // process name\nconst PROGMEM ih::EndOfLineChar process_eol = "{processeol}"; // process end of line characters\nconst PROGMEM ih::ControlCharSeq process_ccseq = "{processinputcontrolchar}"; // input control char sequence\nconst PROGMEM ih::WildcardChar process_wcc = "{processwildcardchar}"; // process wildcard char\n\n// data delimiter sequences\nconst PROGMEM ih::DelimiterSequences pdelimseq = {{\n    {numdelimseq}, // number of delimiter sequences\n    {delimseqlens}, // delimiter sequence lens\n    {delimseqs} // delimiter sequences\n}};\n\n// start stop data delimiter sequences\nconst PROGMEM ih::StartStopSequences process_ststpseq = {{\n    {numstartstoppairs}, // num start stop sequence pairs\n    {startstopseqlens}, // start stop sequence lens\n    {startstopseqs} // start stop sequence pairs\n}};\n\nconst PROGMEM ih::InputParameters input_prm[1] = {{\n    &process_name,\n    &process_eol,\n    &process_ccseq,\n    &process_wcc,\n    &pdelimseq,\n    &process_ststpseq}};\n\n// constructor\n{constructor}{setupfunction}{loopfunction}\n\n#endif\n// end of file\n'#
cli_h_loop_function_string = '\nvoid InputHandler_loop()\n{{{loopstatements}\n}}\n'#
cli_h_setup_function_string = '\nvoid InputHandler_setup()\n{{{setupfunctionentry}{defaultfunction}{commandlist}{begin}{options}{setupfunctionexit}\n}}\n'#
commandparameters_string = '\n/**\n   @brief ih::Parameters struct for {functionname}\n*/\nconst PROGMEM ih::Parameters {functionname}_param[1] = \n{{\n    {functionname}, // function pointer\n    ih::{wildcardflag}, // wildcard flag\n    "{commandstring}", // command string\n    {lencommandstring}, // command string num characters\n    {parentid}, // parent id\n    {commandid}, // this command id (tree unique)\n    {commanddepth}, // command depth\n    {commandsubcommands}, // number of subcommands\n    ih::{argumenthandling}, // argument handling\n    {minnumargs}, // minimum expected number of arguments\n    {maxnumargs}, // maximum expected number of arguments\n    /* UITYPE arguments */\n    {argtypearray}    \n}};\n{commandconstructor}{newline}'#
cpp_md_tag = '\n```cpp\n    {statements}\n```'#
docfs = '/* Generated by cli_gen_tool version <{docs_version}>; using InputHandler version <{lib_version}> */\n/**\n* @file {docs_filename}\n* @author Douglas Quigg (dstroy0 dquigg123@gmail.com)\n* @brief {docs_brief}\n* @version {docs_version}\n* @date {docs_date}\n*\n* @copyright Copyright (c) {docs_year}\n*/\n/*\n{lib_license}\n*/\n'#
fsdb = {'CLI': {'h': {'filestring': '\n#if !defined(__CLI_SETUP__)\n    #define __CLI_SETUP__\n    #include "InputHandler.h"{arduino_compatibility}\n    #include "functions.h"\n    #include "parameters.h"\n\n{outputbuffer}\nconst PROGMEM ih::ProcessName process_name = "{processname}"; // process name\nconst PROGMEM ih::EndOfLineChar process_eol = "{processeol}"; // process end of line characters\nconst PROGMEM ih::ControlCharSeq process_ccseq = "{processinputcontrolchar}"; // input control char sequence\nconst PROGMEM ih::WildcardChar process_wcc = "{processwildcardchar}"; // process wildcard char\n\n// data delimiter sequences\nconst PROGMEM ih::DelimiterSequences pdelimseq = {{\n    {numdelimseq}, // number of delimiter sequences\n    {delimseqlens}, // delimiter sequence lens\n    {delimseqs} // delimiter sequences\n}};\n\n// start stop data delimiter sequences\nconst PROGMEM ih::StartStopSequences process_ststpseq = {{\n    {numstartstoppairs}, // num start stop sequence pairs\n    {startstopseqlens}, // start stop sequence lens\n    {startstopseqs} // start stop sequence pairs\n}};\n\nconst PROGMEM ih::InputParameters input_prm[1] = {{\n    &process_name,\n    &process_eol,\n    &process_ccseq,\n    &process_wcc,\n    &pdelimseq,\n    &process_ststpseq}};\n\n// constructor\n{constructor}{setupfunction}{loopfunction}\n\n#endif\n// end of file\n', 'filestring components': {'addCommand': {'call': '\n  {objectname}.addCommand({commandparametersname});'}, 'arduino compatibility': '\n    #include "InputHandler.cpp"\n', 'begin': {'call': '\n  {objectname}.begin(); // Required. Returns true on success.'}, 'classoutput': '({input_prm}, {outputbuffer}, buffsz({outputbuffer}))', 'constructor': 'ih::Input {objectname}{classoutput};\n', 'defaultFunction': {'call': '\n  {objectname}.defaultFunction({defaultfunctionname}); // default function is called when user input has no match or is not valid'}, 'getCommandFromStream': {'call': '\n  {objectname}.getCommandFromStream({stream}); // parse input'}, 'listCommands': {'call': '\n  {objectname}.listCommands(); // formats {outputbuffer} with the command list'}, 'listSettings': {'call': '\n  {objectname}.listSettings(); // formats {outputbuffer} with the process settings (uses a lot of ram; for setting and testing)'}, 'loop function': '\nvoid InputHandler_loop()\n{{{loopstatements}\n}}\n', 'outputToStream': {'call': '\n  {objectname}.outputToStream({stream}); // class output'}, 'outputbuffer': '\nchar {outputbuffername}[{buffersize}] = {bufferchar}; // output buffer size\n', 'setup function': '\nvoid InputHandler_setup()\n{{{setupfunctionentry}{defaultfunction}{commandlist}{begin}{options}{setupfunctionexit}\n}}\n', 'setup function output': {'buffer': {'entry': '\n  if ((buffsz({outputbuffer})-outputIsAvailable()) > strlen("{outputstring}")+1) {{\n    snprintf_P({outputbuffer} + outputIsAvailable(), "{outputstring}");\n  }}', 'exit': '\n  if ((buffsz({outputbuffer})-outputIsAvailable()) > strlen("{outputstring}")+1) {{\n    snprintf_P({outputbuffer} + outputIsAvailable(), "{outputstring}");\n  }}{ls}{lc}'}, 'stream': {'entry': '\n  {stream}.println(F("{outputstring}"));', 'exit': '\n  {stream}.println(F("{outputstring}"));{ls}\n  {objectname}.outputToStream({stream});{lc}\n  {objectname}.outputToStream({stream});'}}}}}, 'functions': {'h': {'filestring': '\n#if !defined(__FUNCTIONS_H__)\n    #define __FUNCTIONS_H__\n    #include "InputHandler.h"    \n{functionprototypes}\n#endif\n\n// end of file\n', 'filestring components': {'function': 'void {functionname}(ih::Input* _{objectname}){{{statements}}}\n', 'listCommands': {'call': ' _{objectname}->listCommands();'}, 'listSettings': {'call': ' _{objectname}->listSettings();'}, 'outputToStream': {'call': ' _{objectname}->outputToStream({stream});'}, 'return function prototype': '\nextern void {functionname}(ih::Input* _{objectname});'}}}, 'library': {'properties': {'filestring': 'name=Autogenerated InputHandler CLI\nversion={lib_version}\nauthor=dstroy0, Douglas Quigg <dquigg123@gmail.com>\nmaintainer=dstroy0, Douglas Quigg <dquigg123@gmail.com>\nsentence=An Inputhandler microcontroller human interface.\nparagraph=Generated by InputHandlers cli_gen_tool, this interface is comprised of user specified commands.\ncategory=Communications\nurl=https://github.com/dstroy0/InputHandler\narchitectures=*\n'}}, 'parameters': {'h': {'filestring': '\n#if !defined(__PARAMETERS_H__)\n    #define __PARAMETERS_H__\n    #include "cli.h"\n    \n{parameters}\n#endif\n\n// end of file\n', 'filestring components': {'command constructor': 'ih::Command {functionname}_({functionname}_param); // {functionname}_ command constructor', 'nested child': '    *{functionname}_param{comma} // pointer to {functionname}_param{newline}', 'nested command constructor': 'ih::Command {functionname}_({functionname}_param, nprms({functionname}_param), {maxdepth}); // {functionname}_ command constructor', 'nested parameters': '\n/**\n   @brief ih::Parameters struct for {functionname}\n*/\nconst PROGMEM ih::Parameters {functionname}_param[1 /* root */ + {numberofchildren} /* child(ren) */] = \n{{\n    {{\n      {functionname}, // function pointer\n      ih::{wildcardflag}, // wildcard flag\n      "{commandstring}", // command string\n      {lencommandstring}, // command string num characters\n      {parentid}, // parent id\n      {commandid}, // this command id (tree unique)\n      {commanddepth}, // command depth\n      {commandsubcommands}, // number of subcommands\n      ih::{argumenthandling}, // argument handling\n      {minnumargs}, // minimum expected number of arguments\n      {maxnumargs}, // maximum expected number of arguments\n      /* UITYPE arguments */\n      {argtypearray}   \n    }},\n{children}\n}};\n{commandconstructor}\n', 'parameters': '\n/**\n   @brief ih::Parameters struct for {functionname}\n*/\nconst PROGMEM ih::Parameters {functionname}_param[1] = \n{{\n    {functionname}, // function pointer\n    ih::{wildcardflag}, // wildcard flag\n    "{commandstring}", // command string\n    {lencommandstring}, // command string num characters\n    {parentid}, // parent id\n    {commandid}, // this command id (tree unique)\n    {commanddepth}, // command depth\n    {commandsubcommands}, // number of subcommands\n    ih::{argumenthandling}, // argument handling\n    {minnumargs}, // minimum expected number of arguments\n    {maxnumargs}, // maximum expected number of arguments\n    /* UITYPE arguments */\n    {argtypearray}    \n}};\n{commandconstructor}{newline}'}}}, 'readme': {'md': {'filestring components': {'cpp md tag': '\n```cpp\n    {statements}\n```', 'return function code': '\nvoid {functionname}(ih::Input* _{objectname}) \n{{\n    // your statements here\n}}\n'}}}}#
functions_h_fs = '\n#if !defined(__FUNCTIONS_H__)\n    #define __FUNCTIONS_H__\n    #include "InputHandler.h"    \n{functionprototypes}\n#endif\n\n// end of file\n'#
functions_h_function_string = 'void {functionname}(ih::Input* _{objectname}){{{statements}}}\n'#
ih_return_function_code_fs = '\nvoid {functionname}(ih::Input* _{objectname}) \n{{\n    // your statements here\n}}\n'#
lib_license_cpp = '* Copyright (c) {docs_year} Douglas Quigg (dstroy0) <dquigg123@gmail.com>\n*\n* License: GNU GPL3\n* This program is free software; you can redistribute it and/or\n* modify it under the terms of the GNU General Public License\n* version 3 as published by the Free Software Foundation.'#
lib_license_md = '    \nCopyright (c) {docs_year} Douglas Quigg (dstroy0) <dquigg123@gmail.com>  \n  \nLicense: GNU GPL3  \nThis program is free software; you can redistribute it and/or  \nmodify it under the terms of the GNU General Public License  \nversion 3 as published by the Free Software Foundation.  '#
lib_properties = 'name=Autogenerated InputHandler CLI\nversion={lib_version}\nauthor=dstroy0, Douglas Quigg <dquigg123@gmail.com>\nmaintainer=dstroy0, Douglas Quigg <dquigg123@gmail.com>\nsentence=An Inputhandler microcontroller human interface.\nparagraph=Generated by InputHandlers cli_gen_tool, this interface is comprised of user specified commands.\ncategory=Communications\nurl=https://github.com/dstroy0/InputHandler\narchitectures=*\n'#
lib_version = ''#
nested_commandparameters_string = '\n/**\n   @brief ih::Parameters struct for {functionname}\n*/\nconst PROGMEM ih::Parameters {functionname}_param[1 /* root */ + {numberofchildren} /* child(ren) */] = \n{{\n    {{\n      {functionname}, // function pointer\n      ih::{wildcardflag}, // wildcard flag\n      "{commandstring}", // command string\n      {lencommandstring}, // command string num characters\n      {parentid}, // parent id\n      {commandid}, // this command id (tree unique)\n      {commanddepth}, // command depth\n      {commandsubcommands}, // number of subcommands\n      ih::{argumenthandling}, // argument handling\n      {minnumargs}, // minimum expected number of arguments\n      {maxnumargs}, // maximum expected number of arguments\n      /* UITYPE arguments */\n      {argtypearray}   \n    }},\n{children}\n}};\n{commandconstructor}\n'#
parameters_h_fs = '\n#if !defined(__PARAMETERS_H__)\n    #define __PARAMETERS_H__\n    #include "cli.h"\n    \n{parameters}\n#endif\n\n// end of file\n'#
rdme_copy_inst = 'Copy/Paste these functions into your code before setup():'#
rdme_function_inst = 'These are wrappers generated for argument retrieval, or to put custom statements that run on command entry.'#
rdme_gen_inst = '## generated code'#
rdme_include_inst = '\n// copy/paste these preprocessor statements into your include section or at the top of your *.ino\n#include "CLI/setup.h" '#
rdme_loop_inst = 'Copy/Paste this statement into your loop() function:'#
rdme_setup_inst = 'Copy/Paste this statement into your setup() function, after initializing any Streams that you plan on using with the interface you build:'#
readmemd = "<!-- markdownlint-disable MD041 -->    \n# InputHandler autogenerated CLI readme\n\n## tool, library, and generated CLI author \nDouglas Quigg (dstroy0 dquigg123@gmail.com)\n\n## user\n{user}\n\n## brief \nThis file is meant to familiarize you with using cli_gen_tool to integrate the generated CLI\ninto your project.  \n  \nThis readme file was generated by InputHandler's cli_gen_tool.  \n\n## tool version\n{tool_version}  \n\n## InputHandler version\n{lib_version}\n\n## date\n{docs_date}\n\n## copyright\nCopyright (c) {docs_year}\n\n## license \n{lib_license}  \n\n## purpose\nThis tool is meant to assist in constructing/sharing interfaces using InputHandler.  \n\n## docs\nDocumentation for the LIBRARY is available [here](https://dstroy0.github.io/InputHandler/lib/index.html)  \nDocumentation for the TOOL is available [here](https://dstroy0.github.io/InputHandler/cli_gen_tool/index.html)  \n\n## help\nIf you don't see a topic relevant to your issue, please create a new discussion here: [InputHandler help/issue discussion](https://github.com/dstroy0/InputHandler/discussions/categories/help-issue-discussion)  \nDebugging assistance is available here: [InputHandler help/issue discussion](https://github.com/dstroy0/InputHandler/discussions)  \n\n## feature requests\nTo request a new feature please create a new discussion here: [InputHandler Ideas](https://github.com/dstroy0/InputHandler/discussions/categories/ideas)  \n\n## bug reporting\nPlease report bugs in the TOOL using this bug report form: [tool bug report format](https://github.com/dstroy0/InputHandler/blob/main/tools/bug_report.md) [tool bug report forum](https://github.com/dstroy0/InputHandler/discussions/59)  \nPlease report bugs in the LIBRARY using this bug report form: [library bug report format](https://github.com/dstroy0/InputHandler/blob/main/src/bug_report.md) [library bug report forum](https://github.com/dstroy0/InputHandler/discussions/60)  \n\n## disclaimer\nUse this library, and any included tools at your own risk!  \nThe library's authors are not responsible for any damages which arise from the use of this tool (cli_gen_tool.py or its binaries) or library (InputHandler and dependencies).  \nThe software (InputHandler library and cli_gen_tool.py and associated dependencies) conveys no warranty of any kind, implied or otherwise.  \nThe user is ultimately responsible for configuring and implementing their own interface. But I will help you when and if I can, just post in the appropriate  \narea in the library's discussion forum.  \n\n## interface creation instructions\nWhen first creating an interface, it is best practice to set an output stream, buffer size, and enable all builtins.\nThis makes debugging commands easy, it is trivial to disable output after verifying the interface behaves as intended.\n\n{generated_code_section}\n{include_instructions}\n{function_instructions}  \n{copy_instructions}  \n{functions_with_return}\n{setup_instructions}  \n{setup_code}  \n\n{loop_instructions}  \n{loop_code}  \n\n"#
version = ''#