예제 #1
0
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)
예제 #2
0
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
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
def stalker_init():
    w.mkdir_home(STALKER_DIR_NAME, 0755)

    global home
    home = w.info_get('weechat_dir', '')
예제 #6
0
파일: img_viewer.py 프로젝트: pzl/chef-cb
            #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)