text: from typing import Dict, Tuple, Sequence,List
  from .ISpecialID import IStag,IDtag,IBtag,ITag
  import os
  class Mykcommand(IStag):
      kobj=None
      def getName(self) -> str:
          # self.kobj._write_to_stdout("setKernelobj setKernelobj setKernelobj\n")
          
          return 'Mykcommand'
      def getAuthor(self) -> str:
          return 'Author'
      def getIntroduction(self) -> str:
          return 'Mykcommand'
      def getPriority(self)->int:
          return 0
      def getExcludeID(self)->List[str]:
          return []
      def getIDSptag(self) -> List[str]:
          return ['kcmd']
      def setKernelobj(self,obj):
          self.kobj=obj
          # self.kobj._write_to_stdout("setKernelobj setKernelobj setKernelobj\n")
          return
      def on_shutdown(self, restart):
          return
      def on_ISpCodescanning(self,key, value,magics,line) -> str:
          # self.kobj._write_to_stdout(line+" on_ISpCodescanning\n")
          self.kobj.addkey2dict(magics,'kcmd')
          return self.commandhander(self,key, value,magics,line)
      ##在代码预处理前扫描代码时调用    
      def on_Codescanning(self,magics,code)->Tuple[bool,str]:
          pass
          return False,code
      ##生成文件时调用
      def on_before_buildfile(self,code,magics)->Tuple[bool,str]:
          return False,''
      def on_after_buildfile(self,returncode,srcfile,magics)->bool:
          return False
      def on_before_compile(self,code,magics)->Tuple[bool,str]:
          return False,''
      def on_after_compile(self,returncode,binfile,magics)->bool:
          return False
      def on_before_exec(self,code,magics)->Tuple[bool,str]:
          return False,''
      def on_after_exec(self,returncode,srcfile,magics)->bool:
          return False
      def on_after_completion(self,returncode,execfile,magics)->bool:
          return False
      def commandhander(self,key, value,magics,line):
          # self.kobj._write_to_stdout(value+"  exec kcmd...\n")
          magics['kcmd'] = [value]
          if len(magics['kcmd'])>0:
              self.kobj.pluginISList()
              self.kobj.pluginIDList()
              self.kobj.pluginIBList()
              self.kobj._log('------------magics info-------------')
              for key,value in magics.items():
                  self.kobj._log('{key}:{value}'.format(key = key, value = value))
              # self.kobj._log(magics +"\n")
          return ''
      
  