GRAPHIC: New Entity Operations™ Alpha Logo

EntityScript



core_count




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

core_count counts entries in your core.es context-file and can be branched to
check the amount of entries in meta-conected phases that you decide are
import to keep watch over.

You also have default structures to see if the system is currently in debug
mode, or if the system is stateful, thus counting time and providing RTC
functions to the operator

"""
__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-> facilities
from MODE.facilities import (CReal, Cure, STATE_INTERFACE,
 INTERFACE_UP, oFo)

## Imports: Custom
from core_middlelayer import (DIRDATA, PATH_INSTANCE, PHASE_SERVER)

## MODE-> debug_count
from MODE.debug_count import DEBUG_COUNT

## Establish basic counter objects
class COUNTER:
 """
 'COUNTER' provides methods to inspect PHASE_* summary instances
 """
 def tally_core():
  core_lines = CReal.no

  with open(PATH_INSTANCE+DIRDATA+PHASE_SERVER, oFo.read_text) as c:
   for line in c:
    core_lines += CReal.yes
    SEGMENT_COUNT = core_lines-CReal.yes
    DEBUG_COUNT.provide_tallied_core_count(COUNT=SEGMENT_COUNT,
     TYPE="Figments")
  c.close()

## Establish basic state objects
class UP:
 """
 Is the interface up?
 """
 def CHECK_UP():
  """
  Runner to check the internal-up interface
  """
  if INTERFACE_UP == CReal.no:
   DEBUG_COUNT.confirm_interface_is_down()
   return(CReal.no)
  else:
   DEBUG_COUNT.confirm_interface_is_up()
   return(CReal.yes)

class STATE:
 """
 Is the machine state established?
 """
 def CHECK_STATE():
  """
  Runner to check the internal-state
  """
  if STATE_INTERFACE == CReal.no:
   DEBUG_COUNT.confirm_state_is_void()
   return(CReal.no)
  else:
   DEBUG_COUNT.confirm_state_exists()
   return(CReal.yes)




Return HOME