<s> import os <EOL> import googkit . lib . path <EOL> from googkit . lib . error import GoogkitError <EOL> from googkit . lib . i18n import _ <EOL> INIT_FILE = '<STR_LIT>' <EOL> COMMAND_FILE = '<STR_LIT>' <EOL> def load ( tree ) : <EOL> """<STR_LIT>""" <EOL> base_dir = googkit . lib . path . plugin ( ) <EOL> for filename in os . listdir ( base_dir ) : <EOL> plugin_dir = os . path . join ( base_dir , filename ) <EOL> if not os . path . isdir ( plugin_dir ) : <EOL> continue <EOL> init_path = os . path . join ( plugin_dir , INIT_FILE ) <EOL> if not os . path . exists ( init_path ) : <EOL> continue <EOL> command_path = os . path . join ( plugin_dir , COMMAND_FILE ) <EOL> if not os . path . exists ( command_path ) : <EOL> continue <EOL> module_name = '<STR_LIT>' . format ( filename = filename ) <EOL> module = __import__ ( module_name , fromlist = [ '<STR_LIT>' ] ) <EOL> if not hasattr ( module , '<STR_LIT>' ) : <EOL> raise GoogkitError ( _ ( '<STR_LIT>' ) . format ( <EOL> module = module_name ) ) <EOL> module . register ( tree ) </s>
