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


Python ComicTaggerSettings.getGraphic方法代码示例

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


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

示例1: __init__

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
    def __init__(self, parent, mode, expand_on_click=True):
        super(CoverImageWidget, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('coverimagewidget.ui'), self)

        reduceWidgetFontSize(self.label)

        self.mode = mode
        self.comicVine = ComicVineTalker()
        self.page_loader = None
        self.showControls = True

        self.btnLeft.setIcon(QIcon(ComicTaggerSettings.getGraphic('left.png')))
        self.btnRight.setIcon(
            QIcon(ComicTaggerSettings.getGraphic('right.png')))

        self.btnLeft.clicked.connect(self.decrementImage)
        self.btnRight.clicked.connect(self.incrementImage)
        self.resetWidget()
        if expand_on_click:
            clickable(self.lblImage).connect(self.showPopup)
        else:
            self.lblImage.setToolTip("")

        self.updateContent()
开发者ID:goodevilgenius,项目名称:comictagger,代码行数:27,代码来源:coverimagewidget.py

示例2: __init__

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
	def __init__(self, parent, metadata):
		super(PageBrowserWindow, self).__init__(parent)
		
		uic.loadUi(ComicTaggerSettings.getUIFile('pagebrowser.ui' ), self)
		
		self.pageWidget = CoverImageWidget( self.pageContainer, CoverImageWidget.ArchiveMode )
		gridlayout = QtGui.QGridLayout( self.pageContainer )
		gridlayout.addWidget( self.pageWidget )
		gridlayout.setContentsMargins(0,0,0,0)
		self.pageWidget.showControls = False

		self.setWindowFlags(self.windowFlags() |
									  QtCore.Qt.WindowSystemMenuHint |
									  QtCore.Qt.WindowMaximizeButtonHint)
		
		self.comic_archive = None
		self.page_count = 0
		self.current_page_num = 0
		self.metadata = metadata
		
		self.buttonBox.button(QtGui.QDialogButtonBox.Close).setDefault(True)	
		if platform.system() == "Darwin":
			self.btnPrev.setText("<<")
			self.btnNext.setText(">>")
		else:
			self.btnPrev.setIcon(QtGui.QIcon( ComicTaggerSettings.getGraphic('left.png' )))
			self.btnNext.setIcon(QtGui.QIcon( ComicTaggerSettings.getGraphic('right.png')))
		
		self.btnNext.clicked.connect( self.nextPage )
		self.btnPrev.clicked.connect( self.prevPage )
		self.show()
		
		self.btnNext.setEnabled( False )
		self.btnPrev.setEnabled( False )
开发者ID:2mny,项目名称:mylar,代码行数:36,代码来源:pagebrowser.py

示例3: __init__

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
	def __init__(self, parent, image_pixmap):
		super(ImagePopup, self).__init__(parent)
		
		uic.loadUi(ComicTaggerSettings.getUIFile('imagepopup.ui' ), self)

		QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))

		#self.setWindowModality(QtCore.Qt.WindowModal)
		self.setWindowFlags(QtCore.Qt.Popup)
		self.setWindowState(QtCore.Qt.WindowFullScreen)
	
		self.imagePixmap = image_pixmap
		
		screen_size = QtGui.QDesktopWidget().screenGeometry()
		self.resize(screen_size.width(), screen_size.height())
		self.move( 0, 0)
		
		# This is a total hack.  Uses a snapshot of the desktop, and overlays a
		# translucent screen over it.  Probably can do it better by setting opacity of a
		# widget
		self.desktopBg = QtGui.QPixmap.grabWindow(QtGui.QApplication.desktop ().winId(), 
			0,0, screen_size.width(), screen_size.height())
		bg = QtGui.QPixmap(ComicTaggerSettings.getGraphic('popup_bg.png')) 
		self.clientBgPixmap = bg.scaled(screen_size.width(), screen_size.height())		
		self.setMask(self.clientBgPixmap.mask())

		self.applyImagePixmap()
		self.showFullScreen()
		self.raise_(  )
		QtGui.QApplication.restoreOverrideCursor()		
开发者ID:2mny,项目名称:mylar,代码行数:32,代码来源:imagepopup.py

示例4: __init__

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
	def __init__( self, path, settings ):
		self.path = path
		self.ci_xml_filename = 'ComicInfo.xml'
		self.comet_default_filename = 'CoMet.xml'
		self.resetCache()
		self.settings = settings
		
		if self.zipTest():
			self.archive_type =  self.ArchiveType.Zip
			self.archiver = ZipArchiver( self.path )
			
		elif self.rarTest(): 
			self.archive_type =  self.ArchiveType.Rar
			self.archiver = RarArchiver( self.path, settings )
			
		elif os.path.isdir( self.path ):
			self.archive_type =  self.ArchiveType.Folder
			self.archiver = FolderArchiver( self.path )			
		else:
			self.archive_type =  self.ArchiveType.Unknown
			self.archiver = UnknownArchiver( self.path )

		if ComicArchive.logo_data is None:
			fname = ComicTaggerSettings.getGraphic('nocover.png')
			with open(fname, 'rb') as fd:
				ComicArchive.logo_data = fd.read()
开发者ID:goldsoundz,项目名称:comictagger,代码行数:28,代码来源:comicarchive.py

示例5: addPathItem

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
    def addPathItem(self, path):
        path = unicode(path)
        path = os.path.abspath(path)
        # print "processing", path

        if self.isListDupe(path):
            return self.getCurrentListRow(path)

        ca = ComicArchive(
            path,
            self.settings.rar_exe_path,
            ComicTaggerSettings.getGraphic('nocover.png'))

        if ca.seemsToBeAComicArchive():
            row = self.twList.rowCount()
            self.twList.insertRow(row)

            fi = FileInfo(ca)

            filename_item = QTableWidgetItem()
            folder_item = QTableWidgetItem()
            cix_item = FileTableWidgetItem()
            cbi_item = FileTableWidgetItem()
            readonly_item = FileTableWidgetItem()
            type_item = QTableWidgetItem()

            filename_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            filename_item.setData(Qt.UserRole, fi)
            self.twList.setItem(
                row, FileSelectionList.fileColNum, filename_item)

            folder_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            self.twList.setItem(
                row, FileSelectionList.folderColNum, folder_item)

            type_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            self.twList.setItem(row, FileSelectionList.typeColNum, type_item)

            cix_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            cix_item.setTextAlignment(Qt.AlignHCenter)
            self.twList.setItem(row, FileSelectionList.CRFlagColNum, cix_item)

            cbi_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            cbi_item.setTextAlignment(Qt.AlignHCenter)
            self.twList.setItem(row, FileSelectionList.CBLFlagColNum, cbi_item)

            readonly_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            readonly_item.setTextAlignment(Qt.AlignHCenter)
            self.twList.setItem(
                row, FileSelectionList.readonlyColNum, readonly_item)

            self.updateRow(row)

            return row
开发者ID:goodevilgenius,项目名称:comictagger,代码行数:56,代码来源:fileselectionlist.py

示例6: ctmain

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
def ctmain():
    utils.fix_output_encoding()
    settings = ComicTaggerSettings()

    opts = Options()
    opts.parseCmdLineArgs()

    # manage the CV API key
    if opts.cv_api_key:
        if opts.cv_api_key != settings.cv_api_key:
            settings.cv_api_key = opts.cv_api_key
            settings.save()
    if opts.only_set_key:
        print("Key set")
        return

    ComicVineTalker.api_key = settings.cv_api_key

    signal.signal(signal.SIGINT, signal.SIG_DFL)

    if not qt_available and not opts.no_gui:
        opts.no_gui = True
        print >> sys.stderr, "PyQt4 is not available.  ComicTagger is limited to command-line mode."

    if opts.no_gui:
        cli.cli_mode(opts, settings)
    else:
        app = QtGui.QApplication(sys.argv)

        if platform.system() != "Linux":
            img = QtGui.QPixmap(ComicTaggerSettings.getGraphic('tags.png'))

            splash = QtGui.QSplashScreen(img)
            splash.show()
            splash.raise_()
            app.processEvents()

        try:
            tagger_window = TaggerWindow(opts.file_list, settings, opts=opts)
            tagger_window.show()

            if platform.system() != "Linux":
                splash.finish(tagger_window)

            sys.exit(app.exec_())
        except Exception as e:
            QtGui.QMessageBox.critical(
                QtGui.QMainWindow(),
                "Error",
                "Unhandled exception in app:\n" +
                traceback.format_exc())
开发者ID:Kalinon,项目名称:comictagger,代码行数:53,代码来源:main.py

示例7: getQImageFromData

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
	def getQImageFromData(image_data):
		img = QtGui.QImage()
		success = img.loadFromData( image_data )
		if not success:
			try:
				if pil_available:
					#  Qt doesn't understand the format, but maybe PIL does
					# so try to convert the image data to uncompressed tiff format
					im = Image.open(StringIO.StringIO(image_data))
					output = StringIO.StringIO()
					im.save(output, format="TIFF")
					img.loadFromData( output.getvalue() )
					success = True
			except Exception as e:
				pass
		# if still nothing, go with default image
		if not success:
			img.load(ComicTaggerSettings.getGraphic('nocover.png'))
		return img
开发者ID:2mny,项目名称:mylar,代码行数:21,代码来源:utils.py

示例8: display_match_set_for_choice

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
def display_match_set_for_choice(label, match_set, opts, settings):
    print(u"{0} -- {1}:".format(match_set.filename, label))

    # sort match list by year
    match_set.matches.sort(key=lambda k: k['year'])

    for (counter, m) in enumerate(match_set.matches):
        counter += 1
        print(
            u"    {0}. {1} #{2} [{3}] ({4}/{5}) - {6}".format(
                counter,
                m['series'],
                m['issue_number'],
                m['publisher'],
                m['month'],
                m['year'],
                m['issue_title']))
    if opts.interactive:
        while True:
            i = raw_input("Choose a match #, or 's' to skip: ")
            if (i.isdigit() and int(i) in range(
                    1, len(match_set.matches) + 1)) or i == 's':
                break
        if i != 's':
            i = int(i) - 1
            # save the data!
            # we know at this point, that the file is all good to go
            ca = ComicArchive(
                match_set.filename,
                settings.rar_exe_path,
                ComicTaggerSettings.getGraphic('nocover.png'))
            md = create_local_metadata(
                opts, ca, ca.hasMetadata(opts.data_style))
            cv_md = actual_issue_data_fetch(
                match_set.matches[int(i)], settings, opts)
            md.overlay(cv_md)
            actual_metadata_save(ca, opts, md)
开发者ID:DarkSir23,项目名称:mylar,代码行数:39,代码来源:cli.py

示例9: loadDefault

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
	def loadDefault( self ):
		self.current_pixmap = QPixmap(ComicTaggerSettings.getGraphic('nocover.png'))
		#print "loadDefault called"
		self.setDisplayPixmap( 0, 0)
开发者ID:goldsoundz,项目名称:comictagger,代码行数:6,代码来源:coverimagewidget.py

示例10: process_file_cli

# 需要导入模块: from settings import ComicTaggerSettings [as 别名]
# 或者: from settings.ComicTaggerSettings import getGraphic [as 别名]
def process_file_cli(filename, opts, settings, match_results):

    batch_mode = len(opts.file_list) > 1

    ca = ComicArchive(
        filename,
        settings.rar_exe_path,
        ComicTaggerSettings.getGraphic('nocover.png'))

    if not os.path.lexists(filename):
        print >> sys.stderr, "Cannot find " + filename
        return

    if not ca.seemsToBeAComicArchive():
        print >> sys.stderr, "Sorry, but " + \
            filename + "  is not a comic archive!"
        return

    # if not ca.isWritableForStyle(opts.data_style) and (opts.delete_tags or
    # opts.save_tags or opts.rename_file):
    if not ca.isWritable() and (
            opts.delete_tags or opts.copy_tags or opts.save_tags or opts.rename_file):
        print >> sys.stderr, "This archive is not writable for that tag type"
        return

    has = [False, False, False]
    if ca.hasCIX():
        has[MetaDataStyle.CIX] = True
    if ca.hasCBI():
        has[MetaDataStyle.CBI] = True
    if ca.hasCoMet():
        has[MetaDataStyle.COMET] = True

    if opts.print_tags:

        if opts.data_style is None:
            page_count = ca.getNumberOfPages()

            brief = ""

            if batch_mode:
                brief = u"{0}: ".format(filename)

            if ca.isZip():
                brief += "ZIP archive    "
            elif ca.isRar():
                brief += "RAR archive    "
            elif ca.isFolder():
                brief += "Folder archive "

            brief += "({0: >3} pages)".format(page_count)
            brief += "  tags:[ "

            if not (has[MetaDataStyle.CBI] or has[
                    MetaDataStyle.CIX] or has[MetaDataStyle.COMET]):
                brief += "none "
            else:
                if has[MetaDataStyle.CBI]:
                    brief += "CBL "
                if has[MetaDataStyle.CIX]:
                    brief += "CR "
                if has[MetaDataStyle.COMET]:
                    brief += "CoMet "
            brief += "]"

            print brief

        if opts.terse:
            return

        print

        if opts.data_style is None or opts.data_style == MetaDataStyle.CIX:
            if has[MetaDataStyle.CIX]:
                print("--------- ComicRack tags ---------")
                if opts.raw:
                    print(
                        u"{0}".format(
                            unicode(
                                ca.readRawCIX(),
                                errors='ignore')))
                else:
                    print(u"{0}".format(ca.readCIX()))

        if opts.data_style is None or opts.data_style == MetaDataStyle.CBI:
            if has[MetaDataStyle.CBI]:
                print("------- ComicBookLover tags -------")
                if opts.raw:
                    pprint(json.loads(ca.readRawCBI()))
                else:
                    print(u"{0}".format(ca.readCBI()))

        if opts.data_style is None or opts.data_style == MetaDataStyle.COMET:
            if has[MetaDataStyle.COMET]:
                print("----------- CoMet tags -----------")
                if opts.raw:
                    print(u"{0}".format(ca.readRawCoMet()))
                else:
                    print(u"{0}".format(ca.readCoMet()))

#.........这里部分代码省略.........
开发者ID:DarkSir23,项目名称:mylar,代码行数:103,代码来源:cli.py


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