当前位置: 首页>>代码示例>>Python>>正文


Python show_message.show_message函数代码示例

本文整理汇总了Python中show_message.show_message函数的典型用法代码示例。如果您正苦于以下问题:Python show_message函数的具体用法?Python show_message怎么用?Python show_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了show_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: square_four

def square_four(screen, file):
    wait_cursor()
    draw_lines(screen)
    num_imgs = len(gl.files)
    if file >= num_imgs or file <= 0:
        file = 0
    img_four_name = gl.files[file]
    img_four_file = file
    img_four = load_img(img_four_name, screen, 0)
    file = file + 1
    img_four = adjust_img_size(img_four, screen.get_width(), screen.get_height())
    img_four_rect = img_four.get_rect()
    img_four_rect[0] = (screen.get_width() / 2)
    img_four_rect[1] = (screen.get_height() / 2)
    screen.blit(img_four, img_four_rect)
    update(img_four_rect)
    draw_lines(screen)
    if gl.FOUR_STATUS_BARS:
        font_size = 9
        font = pygame.font.Font(gl.FONT_NAME, font_size)
        name = os.path.basename(img_four_name)
        name = check_truncate(screen.get_width(), name)
        img_status = "%s [%d/%d]" % (name, img_four_file + 1, num_imgs)
        raise_up = 12
        show_message(screen, img_status, ((screen.get_width() / 2) + (screen.get_width() / 4 - font.size(img_status)[0]/2), screen.get_height() - raise_up), font_size, ("bold"))
    normal_cursor()
    return (file, img_four_rect, img_four_name, img_four_file)
开发者ID:paulmadore,项目名称:luckyde,代码行数:27,代码来源:four.py

示例2: index_fx

def index_fx(screen, it, font, msg):
    gl.NOT_HOVERED = 0
    fxpos = (it[0][0] - 10, it[0][1] + (font.size(it[1])[1] / 2) - 13,
             it[0][2], it[0][3])
    show_message(".", fxpos, 16, ("bold"))
    show_message("%s%s%s" % (" " * 20, msg, " " * 20), "bottom", 12)
    return fxpos
开发者ID:rkulla,项目名称:imgv,代码行数:7,代码来源:res.py

示例3: get_confirmation

def get_confirmation(screen, confirm_msg):
    paint_screen(screen, gl.IMGV_COLOR)
    pygame.display.update()
    normal_cursor()
    show_message(screen, confirm_msg, "top", 12, ("bold"))
    yes_rect = imgv_button(screen, " YES ", 0, 30, "midtop")
    no_rect = imgv_button(screen, " NO ", 0, 60, "midtop")
    pygame.event.set_blocked(MOUSEMOTION)
    while 1:
        event = pygame.event.poll()
        pygame.time.wait(1)
        cursor = pygame.mouse.get_pos()
        hover_button(yes_rect, cursor, screen, " YES ", 0, 30, "midtop")
        hover_button(no_rect, cursor, screen, " NO ", 0, 60, "midtop")
        hover_cursor(cursor, (yes_rect, no_rect))
        check_quit(event)
        if hit_key(event, K_ESCAPE):
            return 
        if hit_key(event, K_y):
            return "yes"
        if hit_key(event, K_n):
            return "no"
        if event.type == MOUSEBUTTONDOWN and pygame.mouse.get_pressed()[0]:
            if yes_rect.collidepoint(cursor):
                return "yes"
            if no_rect.collidepoint(cursor):
                return "no"
开发者ID:paulmadore,项目名称:luckyde,代码行数:27,代码来源:confirm.py

示例4: view_filter

def view_filter(screen):
    paint_screen(screen, gl.BLACK)
    show_message(screen, "Current filter", "top", 20, ("underline", "bold"))
    show_message(screen, "Imgv will only display files whose filenames:", (5, 30), 15, ("bold"))
    line = 60
    for k in gl.FILTER_COMMAND.keys():
        font = pygame.font.Font(gl.FONT_NAME, 12)
        if k == "startwith":
            ren = font.render("Start with: %s" % gl.FILTER_COMMAND["startwith"], 1, (255, 255, 255), (0, 0, 0))
        if k == "notstartwith":
            ren = font.render("Do not start with:  %s" % gl.FILTER_COMMAND["notstartwith"], 1, (255, 255, 255), (0, 0, 0))
        if k == "endwith":
            ren = font.render("End with:  %s" % gl.FILTER_COMMAND["endwith"], 1, (255, 255, 255), (0, 0, 0))
        if k == "notendwith":
            ren = font.render("Do not end with:  %s" % gl.FILTER_COMMAND["notendwith"], 1, (255, 255, 255), (0, 0, 0))
        if k == "contain":
            ren = font.render("Contain:  %s" % gl.FILTER_COMMAND["contain"], 1, (255, 255, 255), (0, 0, 0))
        if k == "notcontain":
            ren = font.render("Do not contain:  %s" % gl.FILTER_COMMAND["notcontain"], 1, (255, 255, 255), (0, 0, 0))
        ren_rect = ren.get_rect()
        ren_rect[0] = 5
        ren_rect[1] = line
        screen.blit(ren, ren_rect)
        line = line + 30
        update(ren_rect)
    while 1:
        ev = pygame.event.wait()
        check_quit(ev)
        if ev.type == KEYDOWN or ev.type == MOUSEBUTTONDOWN:
            return
开发者ID:paulmadore,项目名称:luckyde,代码行数:30,代码来源:filter_files.py

示例5: open_url

def open_url(screen, img):
    gl.ISURL = 1
    num_imgs = len(gl.files)
    paint_screen(screen, gl.BLACK)
    set_caption("Extract from Web - imgv")
    normal_cursor()
    show_message(screen, "Enter a Web URL to extract images from", 20, 15, ("transparent"))
    gl.URL = ask(screen, "http://")
    if gl.URL != None:
        gl.files = []
        wait_cursor()
        show_message(screen, "Loading. Please wait..", 39, 42, ("transparent"))
        for ext in gl.IMG_TYPES:
            if gl.URL.endswith(ext):
                gl.files.append(str("".join(gl.URL)))
                return (load_img(gl.files[0], screen), 1)
    else:
        return (img, num_imgs)
    gl.files = []
    check_indexhtml()
    if gl.URL_ERROR:
        gl.files.append(gl.ERROR_IMG)
        return (load_img(gl.ERROR_IMG, screen), len(gl.files))
    if len(gl.files) < 1:
        gl.files.append(gl.ERROR_IMG)
    gl.files = [x.replace(" ", "%20") for x in gl.files]  # urls need %20 for spaces
    return (load_img(gl.files[0], screen), len(gl.files))
开发者ID:paulmadore,项目名称:luckyde,代码行数:27,代码来源:open_url.py

示例6: save_remote_img

def save_remote_img(screen, file):
    save_path = gl.DATA_DIR + "downloads" + sep
    filename = gl.files[file]
    paint_screen(screen, gl.BLACK)
    try:
        im = Image.open(gl.REMOTE_IMG_DATA)

        show_message(screen, "Saving: %s" % basename(gl.files[file]), (20, 50), 12, ("bold"))
        show_message(screen, "From: %s" % filename[:filename.rindex('/')] + '/', (20, 70), 12, ("bold"))
        show_message(screen, "To: %s" % save_path, (20, 90), 12, ("bold"))

        im.save(save_path + basename(filename))

        show_message(screen, "Done", (20, 120), 12, ("bold", "underline"))
        show_message(screen, "[Press any key]", "bottom", 15)
        gl.ALREADY_DOWNLOADED = 1
        normal_cursor()
    except:
        return
    
    while 1:
        event = pygame.event.wait()
        check_quit(event)
        #if event.type == KEYDOWN or event.type == MOUSEBUTTONDOWN:
        if event.type == KEYDOWN and event.key not in (K_LALT, K_RALT):
            return
开发者ID:paulmadore,项目名称:luckyde,代码行数:26,代码来源:downloader.py

示例7: histogram

 def histogram(self):
     if not self.pil_info:
         return
     w = self.screen.get_width()
     h = gl.ROW_SEP + 415
     hist = self.im.histogram()
     redlist = hist[0:255]
     greenlist = hist[256:(256 + 255)]
     bluelist = hist[(256 + 255 + 1):]
     wdiv = 1.3 # shorten the width of the histogram
     vdiv = max(hist) / 130 # shorten the height of the histogram
     wpos = 16
     vlen = 175
     if self.pixel_format == "Grayscale":
         for i, v in enumerate(hist):
             if v > vlen: v -= vlen # don't go outside of border on long histograms
             pygame.draw.line(self.screen, gl.SILVER, ((i / wdiv) + wpos, h), ((i / wdiv) + wpos, (h - (v / vdiv))), 1)
     else:
         for i, v in enumerate(redlist):
             if v > vlen: v -= vlen
             pygame.draw.line(self.screen, gl.RED, ((i / wdiv) + wpos, h), ((i / wdiv) + wpos, (h - (v / vdiv))), 1)
         for i, v in enumerate(greenlist):
             if v > vlen: v -= vlen
             pygame.draw.line(self.screen, gl.GREEN, ((i / wdiv) + wpos, h), ((i / wdiv) + wpos, (h - (v / vdiv))), 1)
         for i, v in enumerate(bluelist):
             if v > vlen: v -= vlen
             pygame.draw.line(self.screen, gl.BLUE, ((i / wdiv) + wpos, h), ((i / wdiv) + wpos, (h - (v / vdiv))), 1)
     show_message(self.screen, "Histogram", (wpos + 1, h - 174), 11, ("transparent"))
     pygame.draw.line(self.screen, gl.MSG_COLOR, (wpos - 2, h + 2), (wpos - 2, h - vlen)) # left side of border
     pygame.draw.line(self.screen, gl.MSG_COLOR, ((i / wdiv) + wpos, h - vlen), ((i / wdiv) + wpos, h + 2)) # right side
     pygame.draw.line(self.screen, gl.MSG_COLOR, (wpos - 2, h - vlen), ((i / wdiv) + wpos, h - vlen)) # top 
     pygame.draw.line(self.screen, gl.MSG_COLOR, (wpos - 2, h + 2), ((i / wdiv) + wpos, h + 2)) # bottom 
开发者ID:paulmadore,项目名称:luckyde,代码行数:32,代码来源:verbose.py

示例8: do_view_tagged

def do_view_tagged(screen, num_imgs, file):
    "show all tagged dir names"
    paint_screen(screen, gl.BLACK)
    (esc_rect, close_font) = close_button(screen)
    line = 5
    if len(gl.MULT_DIRS) == 0:
        show_message(screen, "[No directories are currently tagged]", "bottom", 12)
    for d in gl.MULT_DIRS:
        font = pygame.font.Font(gl.FONT_NAME, 9)
        ren = font.render(d, 1, (255, 255, 255), (0, 0, 0))
        ren_rect = ren.get_rect()
        ren_rect[0] = 5
        ren_rect[1] = line
        screen.blit(ren, ren_rect)
        line = line + 12
        update(ren_rect)
    pygame.event.set_allowed(MOUSEMOTION)
    while 1:
        ev = pygame.event.wait()
        check_quit(ev)
        hover_cursor(pygame.mouse.get_pos(), (esc_rect,))
        if ev.type == KEYDOWN and ev.key not in (K_LALT, K_RALT, K_TAB, K_LCTRL, K_RCTRL) or ev.type == MOUSEBUTTONDOWN:
            gl.ADDED_DIR_NUMS = 0
            (num_imgs, file) = show_dirs(screen, num_imgs, file)
            break # break event loop
开发者ID:paulmadore,项目名称:luckyde,代码行数:25,代码来源:dir_nav.py

示例9: error_screen

def error_screen(screen, msg):
   paint_screen(gl.BLACK)
   while 1:
        event = pygame.event.wait()
        show_message(msg, "top", 12)
        check_quit(event)
        if (event.type == KEYDOWN and event.key not in (K_LALT, K_RALT, K_LCTRL, K_RCTRL)) or event.type == MOUSEBUTTONDOWN:
            return
开发者ID:rkulla,项目名称:imgv,代码行数:8,代码来源:error_screen.py

示例10: verbose_info

def verbose_info(screen, new_img, file, num_imgs):
    # main engine
    wait_cursor()
    paint_screen(screen, gl.BLACK)
    try:
        (uniquecolors_rect, total_colors, row, font, im, verb) = print_verbose_info(screen, new_img, file, num_imgs)
    except:
        print 'print verbose'
        #(uniquecolors_rect, total_colors, row, font, im, verb) = junk_rect()#
       # uniquecolors_rect = junk_rect()#
       # total_colors = ""#
        verb = verbose(screen, file)#
        (uniquecolors_rect, total_colors, row, font, im) = verb.colors()
        #return
    if gl.SHOW_EXIFBUTTON:
        exif_rect = imgv_button(screen, " Exif Data ", 5, gl.ROW_SEP + 435, None)
    (esc_rect, close_font) = close_button(screen)
    normal_cursor()
    transparency = 0
    while 1:
        event = pygame.event.poll()
        pygame.time.wait(1)
        check_quit(event)
        cursor = pygame.mouse.get_pos()
        hover_cursor(cursor, (esc_rect, exif_rect, uniquecolors_rect))
        if gl.SHOW_EXIFBUTTON:
            hover_button(exif_rect, cursor, screen, " Exif Data ", 5, gl.ROW_SEP + 435, None)
        if gl.UNIQUE_COLORS == None and gl.SHOW_EXIFBUTTON and total_colors != "":
            hover_button(uniquecolors_rect, cursor, screen, " Unique colors ", (font.size(total_colors)[0] + 230), row, None)

        show_message(screen, convert_times(ctime(), 0), "bottom", 15, ("transparent"))

        if event.type == MOUSEBUTTONDOWN and pygame.mouse.get_pressed()[0]:
            if uniquecolors_rect != junk_rect():
                if uniquecolors_rect.collidepoint(cursor):
                    wait_cursor()
                    gl.UNIQUE_COLORS = comma_it(len(dict.fromkeys(im.getdata()))) # determine unique colors
                    before_color = gl.MSG_COLOR
                    if gl.MSG_COLOR == gl.SILVER:
                        gl.MSG_COLOR = (142, 142, 142)
                    else:
                        gl.MSG_COLOR = gl.SILVER
                    show_message(screen,  "Unique colors: %s%s" % (gl.UNIQUE_COLORS, ' ' * 12), ((font.size(total_colors)[0] + 235), row), 12, (""), (14, before_color))
                    gl.MSG_COLOR = before_color
                    normal_cursor()
            if exif_rect.collidepoint(cursor):
                wait_cursor()
                try:
                    verb.exif_data(file)
                except:
                    break
                normal_cursor()
            if esc_rect.collidepoint(cursor):
                before_exit()
                break
        if event.type == KEYDOWN and event.key not in (K_LALT, K_RALT, K_LCTRL, K_RCTRL, K_TAB):
            before_exit()
            break
开发者ID:paulmadore,项目名称:luckyde,代码行数:58,代码来源:verbose.py

示例11: remote_img_details

def remote_img_details(screen, new_img, rect, file):
    # show no details if image is on a web server
    paint_screen(gl.BLACK)
    while 1:
        event = pygame.event.wait()
        show_message(gl.REMOTE_IMG, (0, 30, 0, 0), 12)
        check_quit(event)
        if event.type == KEYDOWN or event.type == MOUSEBUTTONDOWN:
            return
开发者ID:rkulla,项目名称:imgv,代码行数:9,代码来源:verbose.py

示例12: system_info

 def system_info(self):
     info = pygame.display.Info()
     self.row += gl.ROW_SEP * 2
     show_message("Display Properties", self.row, self.font_size, ("bold", "underline", "transparent"))
     self.row += gl.ROW_SEP
     self.print_info("Using video driver: %s" % pygame.display.get_driver(), 20)
     self.print_info("Video mode is accelerated: %s" % ("No", "Yes")[info.hw], 27)
     self.print_info("Display depth (Bits Per Pixel): %d" % info.bitsize, 31)
     self.print_info("Screen size of imgv: %s" % gl.ORIG_WINSIZE, 21)
开发者ID:rkulla,项目名称:imgv,代码行数:9,代码来源:verbose.py

示例13: play_list_options_msg

def play_list_options_msg(screen, msg):
    paint_screen(gl.BLACK)
    show_message(msg, 100, 10)
    normal_cursor()
    while 1:
        event = pygame.event.wait()
        check_quit(event)
        if event.type == KEYDOWN or event.type == MOUSEBUTTONDOWN:
            wait_cursor()
            break
开发者ID:rkulla,项目名称:imgv,代码行数:10,代码来源:playlist.py

示例14: file_master

def file_master(screen, file_names, place, marker, menu_items, msg, down, button_op):
    paint_screen(gl.BLACK)
    show_message(msg, down, 10, ("bold", "transparent"))
    font = pygame.font.Font(gl.FONT_NAME, 9)
    font.set_bold(1)
    (esc_rect, esc_font) = close_button(screen)
    font_height = font.size(file_names[0])[1]
    screen_height = screen.get_height()
    name_max = 16
    max_file_width = 116
    line = 65 # leave room at top of screen for other stuff
    col = 5
    count = 0
    back_rect = forward_rect = sort_rect = junk_rect()
    for name in file_names[place:]:
        count = count + 1
        place = place + 1
        marker = marker + 1
        if count >= gl.MAX_SCREEN_FILES or place >= len(file_names):
            ren_name = os.path.basename(name)
            if len(ren_name) > name_max:
                ren_name = ren_name[:name_max] + '...' # truncate
                if ren_name[-4:] == '....':
                    ren_name = ren_name[:-1] # 3 .'s are enough
            ren = font.render(ren_name, 1, gl.MSG_COLOR, gl.BLACK)
            if (place + 1) < len(file_names):
                forward_rect = imgv_button(screen, " Next ", 10, 18, "topright")
            if (((place + 1) - gl.MAX_SCREEN_FILES) > 1):
                back_rect = imgv_button(screen, " Previous ", 10, 18, "topleft")
            if not gl.SORT_HIT:
                sort_rect = imgv_button(screen, " Sort ", 13, 42, "midtop")
            ren_rect = ren.get_rect()
            ren_rect[0] = col
            ren_rect[1] = line
            menu_items.append((ren_rect, name))
            screen.blit(ren, ren_rect)
            update(ren_rect)
            return (file_names, menu_items, 1, place, marker, forward_rect, back_rect, sort_rect)
        ren_name = os.path.basename(name)
        if len(ren_name) > name_max:
            ren_name = ren_name[:name_max] + '...'
            if ren_name[-4:] == '....':
                ren_name = ren_name[:-1]
        ren = font.render(ren_name, 1, gl.MSG_COLOR, gl.BLACK)
        ren_rect = ren.get_rect()
        ren_rect[0] = col
        ren_rect[1] = line
        menu_items.append((ren_rect, name))
        screen.blit(ren, ren_rect)
        line = line + 12
        if (line + font_height) >= (screen_height - 15):
            line = 65
            col = col + max_file_width
        update(ren_rect)
    return (file_names, menu_items, 0, place, marker, forward_rect, back_rect, sort_rect)
开发者ID:rkulla,项目名称:imgv,代码行数:55,代码来源:file_master.py

示例15: print_info

 def print_info(self, msg, emphasize_length):
     if msg == " ":
         return
     self.row += gl.ROW_SEP
     before_color = gl.MSG_COLOR
     if gl.MSG_COLOR == gl.SILVER:
         gl.MSG_COLOR = (142, 142, 142)
     else:
         gl.MSG_COLOR = gl.SILVER
     show_message(msg, (self.start_width, self.row), self.font_size, (""), (emphasize_length, before_color))
     gl.MSG_COLOR = before_color
开发者ID:rkulla,项目名称:imgv,代码行数:11,代码来源:verbose.py


注:本文中的show_message.show_message函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。