def create_dir(): """Create the OTR subdirectory in the WeeChat config directory if it does not exist.""" if not os.path.exists(OTR_DIR): weechat.mkdir_home(OTR_DIR_NAME, 0700)
def hipchat_dir(): path = os.path.join(weechat.info_get('weechat_dir', ''), 'hipchat') if not os.path.exists(path): weechat.mkdir_home('hipchat', 0700) return path
def create_flute_dir(dirname): """Create the OTR subdirectory in the WeeChat config directory if it does not exist.""" if not os.path.exists(flute_dir): weechat.mkdir_home(FLUTE_DIR_NAME, 0o700)
def create_viola_dir(dirname): """Create the OTR subdirectory in the WeeChat config directory if it does not exist.""" if not os.path.exists(viola_dir): weechat.mkdir_home(VIOLA_DIR_NAME, 0o700)
def stalker_init(): w.mkdir_home(STALKER_DIR_NAME, 0755) global home home = w.info_get('weechat_dir', '')
#blacklist subprocess.call(['%s/get_view_img.sh' % w.info_get("weechat_dir",""), '%s/img_cache' % w.info_get("weechat_dir",""), url], stdout=FNULL,stderr=subprocess.STDOUT) return w.WEECHAT_RC_OK def config_cb(data, option, value): #wat do return w.WEECHAT_RC_OK def img_viewer_close_cb(): return w.WEECHAT_RC_OK if __name__ == "__main__": if w.register(SCRIPT_NAME,SCRIPT_AUTHOR,SCRIPT_VERSION,"GPL3",SCRIPT_DESC,"img_viewer_close_cb",""): for option, default_value in settings.iteritems(): if not w.config_is_set_plugin(option): w.config_set_plugin(option, default_value) #w.hook_timer w.hook_config("plugins.var.python.%s.*" % SCRIPT_NAME, "config_cb", "") w.hook_print("", "", "://", 1, "url_recv_cb", "") w.mkdir_home("img_cache",0755)