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


Python Library.get_all_images方法代码示例

本文整理汇总了Python中library.Library.get_all_images方法的典型用法代码示例。如果您正苦于以下问题:Python Library.get_all_images方法的具体用法?Python Library.get_all_images怎么用?Python Library.get_all_images使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在library.Library的用法示例。


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

示例1: main

# 需要导入模块: from library import Library [as 别名]
# 或者: from library.Library import get_all_images [as 别名]
def main(args):
    import signal
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    a = QtGui.QApplication(sys.argv)
    library = Library(Config.library_path)
    server = Server('*',
                    Config.req_rep_port,
                    Config.pub_sub_port,
                    library)
    camera = Camera()
    printer = Printer(library)
    slide_show = SlideShow(library)

    server.msg_recieved.connect(camera.process_cmd)
    server.msg_recieved.connect(printer.process_cmd)
    server.msg_recieved.connect(slide_show.process_cmd)
    printer.printing_image.connect(server.printing_image)
    camera.pic_taken.connect(library.add_image)
    camera.count_down_changed.connect(server.count_down_changed)
    camera.live_stream_activated.connect(server.live_stream_activated)
    library.image_added.connect(server.image_added_to_lib)
    
    #qrscanner = QRScanner()
    #camera.new_preview_image.connect(qrscanner.new_preview_image)

    server_thread = Server.startThread(server)
    camera_thread = Camera.startThread(camera)
    
    #camera_thread.started.connect(camera.start_preview)
    #qrscanner_thread = QRScanner.startThread(qrscanner)
    
    def exit_app():
        print 'stopping camera'
        camera.stop()
        print camera_thread.wait()
        print 'stopping server'
        server.stop()
        #print server_thread.wait()
        print 'exit'
        a.quit()
    
    if not args.no_ui:
        #w = Widget(camera,server,library,printer,slide_show)
        w = Widget(slide_show, camera, printer)
        w.grapicsView.scene().take_pic.connect(camera.take_pic)
        w.grapicsView.scene().print_pic.connect(printer.print_pic)
        w.grapicsView.exit_app.connect(exit_app)
        w.show()
        
    
    camera.count_down_started.connect(slide_show.stop)
    library.image_added.connect(slide_show.start)
    for image_name in library.get_all_images():
        slide_show.start(image_name)
        break
        
        
    sys.exit(a.exec_())
开发者ID:Karijini,项目名称:photobooth,代码行数:61,代码来源:main.py

示例2: Library

# 需要导入模块: from library import Library [as 别名]
# 或者: from library.Library import get_all_images [as 别名]
from PySide import QtGui, QtCore

from library import Library
from config import Config

if __name__ == '__main__':
    l = Library(Config.library_path)
    for image_name in l.get_all_images():
        print image_name
        i = QtGui.QImage(l.get_image_path(image_name))
        print i.width()
        print l.get_thumbnail_path(image_name)
        l.generate_thumbnail(image_name)
开发者ID:Karijini,项目名称:photobooth,代码行数:15,代码来源:generate_thumbnails.py


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