GRAPHIC: New Entity Operations™ Alpha Logo

EntityScript





core_operations




# -*- coding: utf-8 -*-
"""
COPYRIGHT (C) 2020-2023 NEW ENTITY OPERATIONS INC. ALL RIGHTS RESERVED
INSTANCE: core_operations
MODIFIED: 2023/05/25
OVERVIEW:

core_operations is the default helper stack for C.ORE containing useful
classes and methods

Copyright 2020-2023 (C) Ryan McKenna All Rights Reserved
Operations File: This should have any periodical operation methods inside
Load in the dependency Files
Main utils: (A)

Import additional utility functions
"""
__version__ = "0.0.8"
__author__ = "Ryan McKenna"
__copyright__ = "Copyright (C) 2020-2023 New Entity Operations Inc."
__credits__ = [
 "Ryan McKenna",
 "New Entity Operations Inc.", "New Entity Operations, LLC"]
__email__ = "Operator@NewEntityOperations.com"
__license__ = "New Entity License"
__maintainer__ = "Ryan McKenna"
__status__ = "Production"

## MODE.debug_steps
from MODE.debug_operations import DEBUG_OPERATIONS
from MODE.debug_steps import DEBUG_STEPS

## MODE-> facilities
from MODE.facilities import (ArgumentParser, BUCKET_EQ, BUCKET_EQA,
 BUCKET_EQO, BUCKET_TEMP_NODE, check_output, CLEAN_ENTITIES_ON_STARTUP,
 copyfile, datetime, getfilesystemencoding, HView, KEY_TEMP, LView,
 NETWORK_MAINTENANCE_ON_STARTUP, OUTPUT_STRUCTURE, Path, PATH_INSTANCE,
 sha512, sleep, SLUG_BROWSEMEH, stat, system, SystemPlatform,
 __breakpointhook__)

# ABOUT Function Here: (C)
from core_middlelayer import (asset_folder, ACTIVEES, CONTROL_FOLDER_AUDIO,
 CONTROL_FOLDER_MEMORY_VAULT, CONTROL_FOLDER_ORE, CONTROL_FOLDER_VISUAL,
 CONTROL_FOLDER_VISUAL_ALT,
 CONTROL_FOLDER_VIDEOS, DIRBACKUP, DIRCONFIG, DIRDATA, DIRLOCATION,
 ENTITY_LOCATION, FOLDER_AUDIO_CONTROL_KEY, FOLDER_ORE_CONTROL_KEY,
 FOLDER_MEMORY_VAULT_KEY, FOLDER_VIDEOS_CONTROL_KEY, FOLDER_VISUAL_CONTROL_KEY,
 FOLDER_VISUAL_CONTROL_KEY_ALT, FOLDER_VISUAL_CONTROL_KEY_SPECIAL,
 SLUG_ENTITY_LEDGER, PHASE_ENTITYSCRIPT_ORE, PHASE_ENTITYSCRIPT_RING,
 PHASE_FIGMENT, PHASE_LOG, PHASE_SERVER)

## Provide reseed/add silos
from CORE import (MANIPULATE_OFFICIAL_ENTRY)

## core_alerts
from core_alerts import (
 ALERT_LOGGING_INFO, ALERT_LOGGING_WARNING, ALERT_LOGGING_FAILURE,
 LOADER_DS, LOADER_ENTITY)

## Provide interfaces
from core_interface import (ALLOWED_LANGUAGES,
 authenticated, Clone, Encoding, ENTITY_COUNTER, EntityScript,
 FILTER_ENTITYSCRIPT_QUALIFIERS as FEQ,
 FILTER_ENTITYSCRIPT_QUALIFIERS_ORE as FEQO,
 FILTER_ENTITYSCRIPT_QUALIFIERS_RING as FEQR,
 get_GENERIC_INTERFACES, Maintenance,
 MergeValues as MValues, PARSE_ENTITIES, PullValues as PValues,
 ReseedValues as RValues, RuntimeNode, Structure, TimeSystem)

## Provide view silos
from core_view import (BUCKET_PHASE, build_phase)

## instance_process_audit
from instance_process_audit.test_defaults import Instance

## OPENPACKAGER.*
from OPENPACKAGER.internal.INDEX_ORGANIZER.KEY_LISTER_INDEX import (
 KEY_WALKER,)

###############################################################################
## Frontend operations
###############################################################################
def UPDATE_ENTITY_STATS():
 """
 Waterfall any stats that need to be updated
 """
 z1 = ENTITY_COUNTER.PHASE_SERVER()
 z2 = ENTITY_COUNTER.PHASE_FIGMENT()
 z3 = ENTITY_COUNTER.ENTITIES()
 z4 = ENTITY_COUNTER.SHOW_SIZE()
 DEBUG_OPERATIONS.update_entity_stats_complete()

###############################################################################
## Updated functions
###############################################################################
## archive_*
def archive_entities():
 """
 Create a tar.gz backup of your ENTITY db
 """
 ArchiveHandler.backup_entities()
 DEBUG_OPERATIONS.archive_entities_complete()

## clone_*
def clone_configurations():
 """
 Copy any configuration instances from DIRCONFIG/* to BACKUPG/CONFIG/*
 """
 ## Perform default cloning routines
 Clone.ini_archive()
 Clone.ini_browsemeh()
 Clone.ini_config()
 Clone.ini_core()
 Clone.ini_design_basics()
 Clone.ini_eventlolli()
 Clone.ini_gatekeeper()
 Clone.ini_interface()
 Clone.ini_lockerlinks()
 Clone.ini_network()
 Clone.ini_openpackager()
 Clone.ini_remindme()
 Clone.ini_ring()
 Clone.ini_special()
 Clone.ini_testing()
 Clone.ini_VCN()
 Clone.ini_XYZObjects()
 Clone.Z_Completed_Task()
 DEBUG_OPERATIONS.clone_configurations_complete()

## build_*_phase produces an instance with various types of output depending
##  on an interface or stateful logic
###############################################################################
## generic
###############################################################################
def build_about_access_instance():
 """
 build an about_acess instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_ACCESS()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_ACCESS",
  TYPE="INFORMATION")

def build_about_asset_instance():
 """
 build an about_asset instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_ASSET()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_ASSET",
  TYPE="INFORMATION")

def build_about_ds_instance():
 """
 build an about_ds instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_DS()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_DS",
  TYPE="INFORMATION")

def build_about_entity_instance():
 """
 build an about_entity instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_ENTITY()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_ENTITY",
  TYPE="INFORMATION")

def build_about_identity_instance():
 """
 build an about_identity instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_IDENTITY()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_IDENTITY",
  TYPE="INFORMATION")

def build_about_ring_instance():
 """
 build an about_ring instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_RING()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_RING",
  TYPE="INFORMATION")

def build_about_supporting_instance():
 """
 build an about_supporting instance
 """
 get_GENERIC_INTERFACES.information_ABOUT_SUPPORTING()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="ABOUT_SUPPORTING",
  TYPE="INFORMATION")

def build_changelog_instance():
 """
 build a changelog instance
 """
 get_GENERIC_INTERFACES.information_CHANGELOG()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="CHANGELOG",
  TYPE="INFORMATION")

def build_core_packages_instance():
 """
 build a core_packages instance
 """
 get_GENERIC_INTERFACES.information_CORE_PACKAGES()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="CORE_PACKAGES",
  TYPE="CORE_PACKAGES")

def build_instance_permissions_instance():
 """
 build a instance_permissions instance
 """
 get_GENERIC_INTERFACES.licenses_INSTANCE_PERMISSIONS()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="LICENSE_PERMISSIONS",
  TYPE="LICENSE")

def build_readme_instance():
 """
 build a readme instance
 """
 get_GENERIC_INTERFACES.information_README()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="README",
  TYPE="INFORMATION")

def build_usage_instance():
 """
 build a usage instance
 """
 get_GENERIC_INTERFACES.information_USAGE()
 DEBUG_OPERATIONS.build_instance_complete(INSTANCE="USAGE",
  TYPE="INFORMATION")

###############################################################################
## dynamic
###############################################################################
##  data-structure global, local are options
def build_control_instance_all():
 """
 Provide an overview of the available build_control silos
 """
 ## Memory Vault
 DEBUG_OPERATIONS.silo_available(CONTROLLER=CONTROL_FOLDER_MEMORY_VAULT,
  SILO=FOLDER_MEMORY_VAULT_KEY)
 ## ORE
 DEBUG_OPERATIONS.silo_available(CONTROLLER=CONTROL_FOLDER_ORE,
  SILO=FOLDER_ORE_CONTROL_KEY)
 ## VISUAL
 DEBUG_OPERATIONS.silo_available(CONTROLLER=CONTROL_FOLDER_VISUAL,
  SILO=FOLDER_VISUAL_CONTROL_KEY)
 ## VISUAL: Alt
 DEBUG_OPERATIONS.silo_available(CONTROLLER=CONTROL_FOLDER_VISUAL_ALT,
  SILO=FOLDER_VISUAL_CONTROL_KEY_SPECIAL)
 ## VIDEOS
 DEBUG_OPERATIONS.silo_available(CONTROLLER=CONTROL_FOLDER_VIDEOS,
  SILO=FOLDER_VIDEOS_CONTROL_KEY)
 ## AUDIO
 DEBUG_OPERATIONS.silo_available(CONTROLLER=CONTROL_FOLDER_AUDIO,
  SILO=FOLDER_AUDIO_CONTROL_KEY)

def build_global_figment_phase():
 """
 build a local figment phase
 """
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=PHASE_FIGMENT,
  helper=LView.helper_figment, logger=LView.logger_figment,
  BUCKET_PHASE=BUCKET_PHASE)

def build_entities_phase(agent):
 """
 build an active entities phase
 """
 ## Generate a PValues value
 PValues.ENTITYSCRIPT_PARSE_LIST(agent)
 ## Query the ring
 EntityScript.instance_read_from_entities(agent)
 ## Build an EntityScript return instance
 build_phase(LINES=0, PRINT=0, dir=DIRDATA,
  file=SLUG_ENTITY_LEDGER,
  location=ENTITY_LOCATION,
  helper=LView.helper_entities_opened,
  logger=LView.logger_entities_opened,
  BUCKET_PHASE=BUCKET_PHASE)

def build_entityscript_active_phase(agent):
 """
 build an active entityscript phase
 """
 ## Generate a PValues value
 PValues.ENTITYSCRIPT_QUALIFIERS(agent)
 ## Query the ring
 EntityScript.instance_read_from_active(agent)
 ## Build an EntityScript return instance
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=ACTIVEES,
  helper=LView.helper_entityscript_active,
  logger=LView.logger_entityscript_active,
  BUCKET_PHASE=BUCKET_PHASE)

def build_entityscript_ore_phase(agent):
 """
 build an entityscript ore phase
 """
 ## Generate a PValues value
 PValues.ENTITYSCRIPT_QUALIFIERS_ORE(agent)
 ## Build an EntityScript return instance
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=PHASE_ENTITYSCRIPT_ORE,
  helper=LView.helper_entityscript_ore,
  logger=LView.logger_entityscript_ore,
  BUCKET_PHASE=BUCKET_EQO)
 ## Filter the query
 FEQO.pull_all_qualifiers(agent)
 ## Query the ring
 EntityScript.instance_read_from_ore(agent)

def build_entityscript_overview_phase(agent):
 """
 build an entityscript overview phase
 """
 ## Generate a PValues value
 PValues.ENTITYSCRIPT_OVERVIEW(agent)
 ## Build an EntityScript return instance
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=PHASE_ENTITYSCRIPT_RING,
  helper=LView.helper_entityscript_overview,
  logger=LView.logger_entityscript_overview,
  BUCKET_PHASE=LAST_QUEEN_SLUG)

def build_entityscript_ring_phase(agent):
 """
 build an entityscript ring phase
 """
 ## Generate a PValues value
 PValues.ENTITYSCRIPT_QUALIFIERS_RING(agent)
 ## Query the ring
 EntityScript.instance_read_from_ring(agent)
 ## Build an EntityScript return instance
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=PHASE_ENTITYSCRIPT_RING,
  helper=LView.helper_entityscript_ring,
  logger=LView.logger_entityscript_ring,
  BUCKET_PHASE=BUCKET_PHASE)

def build_language_list_programming():
 """
 build a language list containing programming languages: Extend this
 with each additional programming language interface that you need
 to support and provide information for
 """
 ALLOWED_LANGUAGES.allowed_lang_BASH()
 ALLOWED_LANGUAGES.allowed_lang_PHP()
 ALLOWED_LANGUAGES.allowed_lang_PYTHON()
 ALLOWED_LANGUAGES.allowed_lang_RUBY()

def build_local_server_phase():
 """
 build a local server_phase
 """
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=PHASE_SERVER,
  helper=LView.helper_server, logger=LView.logger_server,
  BUCKET_PHASE=BUCKET_PHASE)

def build_log_complete():
 """
 build a log instance
 """
 build_phase(LINES=0, PRINT=0, dir=DIRDATA, file=PHASE_LOG,
  helper=LView.helper_log, logger=LView.logger_log,
  BUCKET_PHASE=BUCKET_PHASE)

def build_program_structure_default():
 """
 build the default program structure: You can preload a structure in and
 kill the program if you need to when the startup structure does not match.

 This is stored in 'settings' or 'build.py' and it can be referenced

 You can also use this to check if the folder structure is not empty, or
 similar, and if the conditions are not met - alert!

 Disabled by default
 """
 pass

def build_program_structure_generic():
 """
 build the generic structure and output the results into a discoverable location

 directories that are considered 'non-essential' or
 personal are excluded. Make sure you back them up in another method, as they
 are not checked for verification by default with the generic routine

 There is also a system-level function on top of this
 """
 Structure.assemble()

def merge_server_phase_backup():
 """
 Merge a local SERVER instance phase into a GLOBAL one and perform the default
 backup routine for the phase
 """
 MValues.and_backup_server_phase()

def merge_server_phase_no_backup():
 """
 Merge a local SERVER instance phase into a GLOBAL and skip the default
 backup routine for the phase
 """
 MValues.and_do_not_backup_server_phase()

def read_active_member():
 """
 Read the active member
 """
 z = authenticated.read_active_member_data()
 return(z)

## perform_*
def perform_archive_extraction_gz(single=0, TEMP=1):
 ArchiveHandler.temporary_instance(single=single, TEMP=TEMP)
 ArchiveHandler.extract_node_gz()

def perform_archive_extraction_tar(single=0, TEMP=1):
 ArchiveHandler.temporary_instance(single=single, TEMP=TEMP)
 ArchiveHandler.extract_node_tar()

def perform_archive_extraction_zip(single=0, TEMP=1):
 ArchiveHandler.temporary_instance(single=single, TEMP=TEMP)
 ArchiveHandler.extract_node_zip()

## reseed_*S
def reseed_global_figment_phase():
 """
 Reseed a global instance phase, and reset it to the default value
 """
 MANIPULATE_OFFICIAL_ENTRY.reseed_figment()

## reseed_entities
def reseed_maintenance_locations():
  Maintenance()

def reseed_local_server_phase():
 """
 Reseed a global instance phase, and reset it to the default value
 """
 MANIPULATE_OFFICIAL_ENTRY.reseed_server()

## AlientVault
class AlienVault:
 def get_ALIEN_VAULT_CODES(HASHED_LOGIN_KEY):
  vault_1 = sha512()
  # 
  encryptor = HASHED_LOGIN_KEY.encode()
  vault_1.update(encryptor)
  sent = vault_1.hexdigest()
  if sent == KEY_TEMP.key_holder_plain[0]:
   KEY_TEMP.key_holder_plain.clear()
   return True

  else:
   KEY_TEMP.key_holder_plain.clear()
   return False

  ## return the message
  return(sent)

 def make_ALIEN_VAULT_CODES(HASHED_LOGIN_KEY):
  vault_1 = sha512()
  # 
  encryptor = HASHED_LOGIN_KEY.encode()
  vault_1.update(encryptor)
  sent = vault_1.hexdigest()
  return(sent)

## BrowseMeh
class PathRetrieverBrowsemeh:
 def get_CONSTRUCTED_PATH():
  """
  Return an active tuple of the broken apart path for TRINE
  """
  ## Provide the browsemeh components
  p = Path(SLUG_BROWSEMEH)
  z = p.absolute()
  ## return the browsemeh parts
  def return_parts():
   for part in z.parts:
    DEBUG_OPERATIONS.provide_browsemeh_part(PART=part)

  ## Comment or uncomment one of the other. You can also hook this into an
  ## automatic lookup that is configured at runtime if you want to switch
  ## between systems

  ## return the path with a curred ending.
  return(str(z)+"/")

  ## For windows and network routines, enable the as_uri
  #return(z.as_uri())

################################################################################
## New Entity Operations
################################################################################
class GenerateEntityLedger:
 """
 When you want to generate a new entity snapshot that can be read by
 the entity-access programs, clean_entity_list will generate a new one from
 your ENTITY_ASSET_LOCATION, which will save to the ENTITY_LEDGER_FILE.
 By default, this file is localized, while the ENTITY_ASSET_LOCATION can be
 in another foreign directory and be accessed through any desired security
 control program
 """
 def clean_entity_list():
  RValues.entity_ledger()

## Make a Verbose Index of your Entity Library
def append_to_entity_list():
 """
 Takes an entity list, 'el' and adds an entry to the entity list file
 """
 pass

def check_entity_structure():
 """
 Scans all .entity files listed in DS0000000.ds and checks each for
 schematics
 """
 pass

def delete_from_entity_list():
 """
 Takes an entity list, 'el' and deletes an entry to the entity list file
 at a defined position
 """
 pass

def generate_entity_library():
 """
 Scans your active .entity files and makes an archive of them
 in the file DS0000000.ds, with all relevant items in entity form
 """
 pass

def generate_entity_list():
 """
 Scans active category lists and creates a sub-list for entity scanning
 This takes the
 """
 pass

def modify_from_entity_list():
 """
 Takes an entity list, 'el' and modifies an entry at the
 defined position, 'p'
 """
 pass

def parse_entity(object):
 """
 Parse a .entity script utilizing csv logic.
 .entity files must double quote both headings and blocks in order to run
 advanced options
 """
 PARSE_ENTITIES.parse_entity_instance(object)

## Verbose Read Node
class VerboseAboutNode:
 """
 Get more information about and command options for a passed NODE
 object
 Provide any imported package to get the meta-output
 core_operations.VerboseAboutNode.inspect_node(core_operations)
 core_operations.VerboseAboutNode.inspect_node(
  core_operations.read_active_member)
 core_operations.VerboseAboutNode.help_node(
  core_operations.read_active_member)
 """
 def inspect_node(NODE):
  for item in dir(NODE):
   DEBUG_OPERATIONS.provide_inspected_node(NODE=item)

  ## Provide a programmatic breakpoint
  #print(__breakpointhook__)
  return(__breakpointhook__)

 ## the help node takes no debugging instance because it's a terminal process
 def help_node(NODE):
  help(NODE)

################################################################################
## Setup
################################################################################
class CustomOptions:
 """
 CustomOptions allow you to build in any default runner routines with any
 desired subsystems you want. These may be cron jobs, or bash scripts, as well
 as other shell scripts or even extensions to other programs.

 By default, dugout is the system-level runner abstraction that ships default
 with TRINE
 """
 def perform_custom_routines():
  #*********************************#
  # START: STEP 7: - CUSTOM OPTIONS #
  #*********************************#
  ## Build custom options into the runtime environment
  DEBUG_STEPS.step_7(MODE="START")
  DEBUG_OPERATIONS.provide_custom_arguments(ARGUMENTS="NONE")
  DEBUG_STEPS.step_7(MODE="STOP")
  #*************#
  # END: STEP 7 #
  #*************#

## Class: Error checker
def ErrorStateMachine(object_option='a'):
 """
 Basic state checker and logging machine
 """
 if object_option=='a':
  """
  Default 'object_option' but plans are to expand this eventually
  A possible refactored interface will be available soon that can run more
  robust tests
  """
  ABSORBED_INSTANCE = Instance.absorb()
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)
 elif object_option=='b':
  """
  Check against a standard critera for cert 'ALERT' status messages.
  """
  ABSORBED_INSTANCE = ALERT_LOGGING_INFO.absorb()
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)
  ABSORBED_INSTANCE = ALERT_LOGGING_WARNING.absorb()
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)
  ABSORBED_INSTANCE = ALERT_LOGGING_FAILURE.absorb()
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)
 elif object_option=='c':
  """
  Check the configuration of your .entity formats and .ds 'datascript' files
  """
  ABSORBED_INSTANCE = LOADER_DS.absorb()
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)
  ABSORBED_INSTANCE = LOADER_ENTITY.absorb()
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)
 else:
  ABSORBED_INSTANCE = "PASSED"
  DEBUG_OPERATIONS.absorb_instance(INSTANCE=ABSORBED_INSTANCE)

## Skipper can be applied to skip certain unit functions with the pass param
skipper = ErrorStateMachine(object_option='pass')

## VerifyTest* Use VerifyTest* to verify system information
class VerifyTestPlatform:
 """
 Verify the stystem platform is as you expect
 """
 def run():
  encoding_in_use = getfilesystemencoding()
  platform_in_use = SystemPlatform.get_platform()
  #**********************************************************#
  # START: STEP 4-> ESTABLISH RUNTIME ENVIRONEMENT           #
  #**********************************************************#
  DEBUG_STEPS.step_4(MODE="START")
  DEBUG_OPERATIONS.provide_runtime_variables(ENCODING=encoding_in_use,
   PLATFORM=platform_in_use)
  DEBUG_STEPS.step_4(MODE="STOP")
  return({'Platform': str(platform_in_use), 'Encoding': str(encoding_in_use)})
  #**********************************************************#
  # STOP: STEP 4-> ESTABLISH RUNTIME ENVIRONEMENT            #
  #**********************************************************#

## VerifyTest: Generic startup verification task silo
class VerifyCheck:
 """
 Default 'Verification' of global instances that are expected to be provided
 to the program on startup as the default 'okay' instance slug
 """
 def do():
  """
  execute the routine
  """
  #**********************************************************#
  # START: FINAL - BUILD CONFIRMATION                        #
  #**********************************************************#
  DEBUG_STEPS.finalize_build_confirmation(MODE="START")
  ## Provide any GLOBALS here
  ## Provide any *_output here
  def simple_output():
   GLOBAL_CHECK_A = 'BUILD COMPLETE: YOU ARE A-OKAY!'
   DEBUG_STEPS.verify_build(GLOBAL=GLOBAL_CHECK_A)
   return(GLOBAL_CHECK_A)

  ## runner
  simple_output()
  #**********************************************************#
  # STOP: FINAL - BUILD CONFIRMATION                         #
  #**********************************************************#
  DEBUG_STEPS.finalize_build_confirmation(MODE="STOP")

## SetupStandard
class SetupStandard:
 """
 Create a standard startup method.

 Allow for a the setup or display of information. All Build-based routines
 go in the subclass build. All reseed routines go in the subclass reseed

 If the routine is conditional, add it to 'SetupCustom'
 """
 class build:
  def tree():
   """
   Build startup routines
   """
   z = getfilesystemencoding()
   setup_encoding_file_system = Encoding.file_system()

   if z == setup_encoding_file_system:
    #**********************#
    # START: STEP 5        #
    #**********************#
    DEBUG_STEPS.step_5(MODE="START")
    RuntimeNode.establish()
    DEBUG_STEPS.step_5(MODE="STOP")
    #**********************#
    # STOP: STEP 5         #
    #**********************#
    #**********************#
    # START: STEP 6        #
    #**********************#
    DEBUG_STEPS.step_6(MODE="START")
    RuntimeNode.assemble_structure()
    DEBUG_STEPS.step_6(MODE="STOP")
   else:
    #**********************#
    # START: STEP 5        #
    #**********************#
    DEBUG_STEPS.step_5(MODE="START")
    RuntimeNode.set_environments()
    DEBUG_STEPS.step_5(MODE="STOP")
    #**********************#
    # STOP: STEP 5         #
    #**********************#

 class generate:
  def information():
   """
   Platform runtime information checks:
   Modify behavior in the program based on a provided system
   """
   VerifyTestPlatform.run()

 class reseed:
  """
  Destroy and regenerate old instances
  """
  def tear_down():
   pass

## SetupCustom
class SetupCustom:
 """
 SetupCustom allows you to setup define runtime behavior
 """
 class build:
  """
  build branched startup-runtime routines
  """
  def tree():
    pass

 class generate:
  def information():
   """
   Platform extended-custom runtime information checks:
   Modify behavior in the program based on a provided system
   """
   VerifyTestPlatform.run()

 class reseed:
  """
  Destroy and regenerate old instances: Empy by default
  """
  def rebuild():
   pass

  def destroy():
   pass

  def save():
   pass

  def tear_down():
   pass

###############################################################################
## Generic, runtime
###############################################################################
## default routines
SetupStandard.generate.information()
SetupStandard.build.tree()

## main module. In this case 'core_operations'
## The default ARGS runner will run at every import
ap = ArgumentParser(description="Run programs with 'core_operate' by utilzing"+\
 " Argument Parsing options.")
ap.add_argument('--reseed', help='Reseed desired file types')
# Setup the representative string versions for comparison
ARGUMENT_LOGIC = ap.parse_args()
REPRESENTED_LOGIC = str(ARGUMENT_LOGIC)

DEBUG_OPERATIONS.verify_parser(PARSER=REPRESENTED_LOGIC)

# Sanity Testers
#print(ARGUMENT_LOGIC)
#print(REPRESENTED_LOGIC)
if REPRESENTED_LOGIC == "Namespace(reseed=None)":
 DEBUG_OPERATIONS.verify_parser_type(LOGIC="NONE")
 CustomOptions.perform_custom_routines()
elif REPRESENTED_LOGIC == None:
 DEBUG_OPERATIONS.verify_parser_type(LOGIC=None)
elif REPRESENTED_LOGIC == "Namespace(reseed='a')":
 DEBUG_OPERATIONS.verify_parser_type(LOGIC="a")
 reseed_maintenance_locations()
else:
 DEBUG_OPERATIONS.verify_parser_type(LOGIC="Z")

################################################################################
## Default Runners
if CLEAN_ENTITIES_ON_STARTUP == 1:
 ## Optional runner
 DEBUG_OPERATIONS.perform_clean_entities_on_startup(OPTION="YES")
 GenerateEntityLedger.clean_entity_list()
else:
 DEBUG_OPERATIONS.perform_clean_entities_on_startup(OPTION="NO")

if NETWORK_MAINTENANCE_ON_STARTUP == 1:
 ## Optional runner: If you wish to perform additional network
 DEBUG_OPERATIONS.perform_network_maintenance_on_startup("YES")
 ## routines on startup, link them below
 reseed_maintenance_locations()
else:
 DEBUG_OPERATIONS.perform_network_maintenance_on_startup("NO")



Return HOME