parameters: ()
return_statement: return True
docstring: Load SERVERTALK OPCODES into memory
docstring_summary: Load SERVERTALK OPCODES into memory
docstring_tokens: Load SERVERTALK OPCODES into memory
function: def loadservertalkopcodes():
      """ Load SERVERTALK OPCODES into memory """
  
      if VERBOSE:
          dprint('entering \'loadservertalkopcodes()\'\n')
  
      try:
          file_name = '{0}/common/servertalk.h'.format(base_path)
  
          vprint(file_name)
  
          with open(file_name, 'r') as data_file:
              if VERBOSE:
                  dprint('->open: \'{0}\' in \'r\' mode\n'.format(file_name))
  
              line_no = 0
  
              for data_line in data_file:
                  line_no += 1
  
                  if not data_line[:7] == '#define':
                      continue
  
                  key_begin = data_line.find('ServerOP_', 8)
                  key_end = data_line.find('0x', key_begin)
  
                  if key_begin < 0 or key_end < 0:
                      continue
  
                  key_value = data_line[key_begin:key_end]
                  key_value = key_value.rstrip()
  
                  val_begin = key_end
                  val_end = val_begin + 6
  
                  servertalk_opcodes[key_value] = data_line[val_begin:val_end]
                  
                  if VERBOSE:
                      dprint('../common/servertalk.h({0}:{1}) \'Servers\' [{2}] = {3}\n'.format(
                          line_no,
                          key_begin,
                          key_value,
                          servertalk_opcodes[key_value]
                      ))
  
          data_file.close()
  
          if VERBOSE:
              dprint('->close: \'{0}\'\n'.format(file_name))
  
          
      except:
          print('(Exception Error: {0}) loadservertalkopcodes()'.format(sys.exc_info()[0]))
  
          dprint('leaving \'loadservertalkopcodes(): EXCEPTION ERROR\'\n\n')
  
          return False
  
      if not len(servertalk_opcodes) > 0:
          print('Could not locate servertalk opcode list...')
  
          dprint('leaving \'loadservertalkopcodes(): SERVERTALK OPCODES NOT FOUND\'\n\n')
  
          return False
  
      if VERBOSE:
          dprint('leaving \'loadservertalkopcodes()\'\n\n')
  
      return True
function_tokens: def loadservertalkopcodes ( ) : if VERBOSE : dprint ( 'entering \'loadservertalkopcodes()\'\n' ) try : file_name = '{0}/common/servertalk.h' . format ( base_path ) vprint ( file_name ) with open ( file_name , 'r' ) as data_file : if VERBOSE : dprint ( '->open: \'{0}\' in \'r\' mode\n' . format ( file_name ) ) line_no = 0 for data_line in data_file : line_no += 1 if not data_line [ : 7 ] == '#define' : continue key_begin = data_line . find ( 'ServerOP_' , 8 ) key_end = data_line . find ( '0x' , key_begin ) if key_begin < 0 or key_end < 0 : continue key_value = data_line [ key_begin : key_end ] key_value = key_value . rstrip ( ) val_begin = key_end val_end = val_begin + 6 servertalk_opcodes [ key_value ] = data_line [ val_begin : val_end ] if VERBOSE : dprint ( '../common/servertalk.h({0}:{1}) \'Servers\' [{2}] = {3}\n' . format ( line_no , key_begin , key_value , servertalk_opcodes [ key_value ] ) ) data_file . close ( ) if VERBOSE : dprint ( '->close: \'{0}\'\n' . format ( file_name ) ) except : print ( '(Exception Error: {0}) loadservertalkopcodes()' . format ( sys . exc_info ( ) [ 0 ] ) ) dprint ( 'leaving \'loadservertalkopcodes(): EXCEPTION ERROR\'\n\n' ) return False if not len ( servertalk_opcodes ) > 0 : print ( 'Could not locate servertalk opcode list...' ) dprint ( 'leaving \'loadservertalkopcodes(): SERVERTALK OPCODES NOT FOUND\'\n\n' ) return False if VERBOSE : dprint ( 'leaving \'loadservertalkopcodes()\'\n\n' ) return True