Got mac freeze and packaging working
git-svn-id: http://comictagger.googlecode.com/svn/trunk@34 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
parent
850cd38cf4
commit
448e2a9d89
@ -20,7 +20,8 @@ limitations under the License.
|
||||
|
||||
|
||||
from PyQt4 import QtCore, QtGui, uic
|
||||
|
||||
from settings import ComicTaggerSettings
|
||||
import os
|
||||
|
||||
class CreditEditorWindow(QtGui.QDialog):
|
||||
|
||||
@ -32,7 +33,7 @@ class CreditEditorWindow(QtGui.QDialog):
|
||||
def __init__(self, parent, mode, role, name ):
|
||||
super(CreditEditorWindow, self).__init__(parent)
|
||||
|
||||
uic.loadUi('crediteditorwindow.ui', self)
|
||||
uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'crediteditorwindow.ui' ), self)
|
||||
|
||||
self.mode = mode
|
||||
|
||||
|
@ -27,6 +27,7 @@ from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest
|
||||
|
||||
from comicvinetalker import ComicVineTalker
|
||||
from imagefetcher import ImageFetcher
|
||||
from settings import ComicTaggerSettings
|
||||
|
||||
class IssueSelectionWindow(QtGui.QDialog):
|
||||
|
||||
@ -35,7 +36,7 @@ class IssueSelectionWindow(QtGui.QDialog):
|
||||
def __init__(self, parent, settings, series_id, issue_number):
|
||||
super(IssueSelectionWindow, self).__init__(parent)
|
||||
|
||||
uic.loadUi('issueselectionwindow.ui', self)
|
||||
uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'issueselectionwindow.ui' ), self)
|
||||
|
||||
self.series_id = series_id
|
||||
self.settings = settings
|
||||
@ -125,7 +126,7 @@ class IssueSelectionWindow(QtGui.QDialog):
|
||||
|
||||
self.issue_number = record['issue_number']
|
||||
|
||||
self.labelThumbnail.setPixmap(QtGui.QPixmap(os.getcwd() + "/nocover.png"))
|
||||
self.labelThumbnail.setPixmap(QtGui.QPixmap(os.path.join(ComicTaggerSettings.baseDir(), 'nocover.png' )))
|
||||
|
||||
self.cv = ComicVineTalker( self.settings.cv_api_key )
|
||||
self.cv.urlFetchComplete.connect( self.urlFetchComplete )
|
||||
|
56
mac/Makefile
Normal file
56
mac/Makefile
Normal file
@ -0,0 +1,56 @@
|
||||
PY2INSTALLER_CMD := python $(HOME)/pyinstaller-2.0/pyinstaller.py
|
||||
TAGGER_BASE := $(HOME)/Dropbox/tagger/comictagger
|
||||
|
||||
APP_NAME := ComicTagger
|
||||
VERSION_STR := 1.0
|
||||
|
||||
MAC_BASE := $(TAGGER_BASE)/mac
|
||||
DIST_DIR := $(MAC_BASE)/dist
|
||||
STAGING := $(MAC_BASE)/$(APP_NAME)
|
||||
APP_BUNDLE := $(DIST_DIR)/$(APP_NAME).app
|
||||
VOLUME_NAME := $(APP_NAME)-$(VERSION_STR)
|
||||
DMG_FILE := $(VOLUME_NAME).dmg
|
||||
|
||||
all: clean dist
|
||||
|
||||
dist:
|
||||
$(PY2INSTALLER_CMD) tagger.py -o $(MAC_BASE) -w -n $(APP_NAME) -s
|
||||
cp $(TAGGER_BASE)/*.ui $(TAGGER_BASE)/*.png $(APP_BUNDLE)/Contents/MacOS
|
||||
cp $(MAC_BASE)/app.icns $(APP_BUNDLE)/Contents/Resources/icon-windowed.icns
|
||||
clean:
|
||||
rm -rf $(DIST_DIR) $(MAC_BASE)/build
|
||||
rm -f $(MAC_BASE)/*.spec
|
||||
rm -f "*~" *.pyc *.pyo
|
||||
|
||||
diskimage:
|
||||
|
||||
|
||||
#Set up disk image staging folder
|
||||
rm -rf $(STAGING)
|
||||
mkdir $(STAGING)
|
||||
#cp $(TAGGER_BASE)/README.txt $(STAGING)
|
||||
cp -a $(APP_BUNDLE) $(STAGING)
|
||||
cp $(MAC_BASE)/volume.icns $(STAGING)/.VolumeIcon.icns
|
||||
SetFile -c icnC $(STAGING)/.VolumeIcon.icns
|
||||
|
||||
##generate raw disk image
|
||||
rm -f $(DMG_FILE)
|
||||
hdiutil create -srcfolder $(STAGING) -volname $(VOLUME_NAME) -format UDRW -ov raw-$(DMG_FILE)
|
||||
|
||||
#remove working files and folders
|
||||
rm -rf $(STAGING)
|
||||
|
||||
# we now have a raw DMG file.
|
||||
|
||||
# remount it so we can set the volume icon properly
|
||||
mkdir -p $(STAGING)
|
||||
hdiutil attach raw-$(DMG_FILE) -mountpoint $(STAGING)
|
||||
SetFile -a C $(STAGING)
|
||||
hdiutil detach $(STAGING)
|
||||
rm -rf $(STAGING)
|
||||
|
||||
# convert the raw image
|
||||
rm -f $(DMG_FILE)
|
||||
hdiutil convert raw-$(DMG_FILE) -format UDZO -o $(DMG_FILE)
|
||||
rm -f raw-$(DMG_FILE)
|
||||
|
BIN
mac/app.icns
Normal file
BIN
mac/app.icns
Normal file
Binary file not shown.
BIN
mac/volume.icns
Normal file
BIN
mac/volume.icns
Normal file
Binary file not shown.
@ -36,7 +36,7 @@ class MetaDataStyle:
|
||||
class Options:
|
||||
|
||||
def __init__(self):
|
||||
self.data_style = MetaDataStyle.CBI
|
||||
self.data_style = MetaDataStyle.CIX
|
||||
self.no_gui = False
|
||||
|
||||
self.series_name = ''
|
||||
@ -44,7 +44,11 @@ class Options:
|
||||
self.filename = ''
|
||||
self.image_hasher = 1
|
||||
|
||||
def parseCmdLineArgs(self):
|
||||
def parseCmdLineArgs(self):
|
||||
|
||||
# mac no likey this from .app bundle
|
||||
if getattr(sys, 'frozen', None):
|
||||
return
|
||||
|
||||
# parse command line options
|
||||
try:
|
||||
|
@ -20,7 +20,8 @@ limitations under the License.
|
||||
|
||||
import sys
|
||||
from PyQt4 import QtCore, QtGui, uic
|
||||
|
||||
import os
|
||||
from settings import ComicTaggerSettings
|
||||
|
||||
|
||||
class IDProgressWindow(QtGui.QDialog):
|
||||
@ -29,7 +30,7 @@ class IDProgressWindow(QtGui.QDialog):
|
||||
def __init__(self, parent):
|
||||
super(IDProgressWindow, self).__init__(parent)
|
||||
|
||||
uic.loadUi('progresswindow.ui', self)
|
||||
uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'progresswindow.ui' ), self)
|
||||
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Image Identification Progress</string>
|
||||
<string>Issue Identification Progress</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
|
@ -20,6 +20,7 @@ limitations under the License.
|
||||
|
||||
#import sys
|
||||
import os
|
||||
import sys
|
||||
import ConfigParser
|
||||
import platform
|
||||
|
||||
@ -40,6 +41,14 @@ class ComicTaggerSettings:
|
||||
return os.path.join( os.environ['APPDATA'], 'ComicTagger' )
|
||||
else:
|
||||
return os.path.join( os.path.expanduser('~') , '.ComicTagger')
|
||||
|
||||
@staticmethod
|
||||
def baseDir():
|
||||
if getattr(sys, 'frozen', None):
|
||||
return sys._MEIPASS
|
||||
else:
|
||||
return os.path.dirname(__file__)
|
||||
|
||||
|
||||
def __init__(self):
|
||||
|
||||
|
@ -55,7 +55,8 @@ class SettingsWindow(QtGui.QDialog):
|
||||
def __init__(self, parent, settings ):
|
||||
super(SettingsWindow, self).__init__(parent)
|
||||
|
||||
uic.loadUi('settingswindow.ui', self)
|
||||
uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'settingswindow.ui' ), self)
|
||||
|
||||
self.settings = settings
|
||||
|
||||
if platform.system() == "Windows":
|
||||
|
@ -45,11 +45,12 @@ class TaggerWindow( QtGui.QMainWindow):
|
||||
def __init__(self, opts, settings, parent = None):
|
||||
super(TaggerWindow, self).__init__(parent)
|
||||
|
||||
uic.loadUi('taggerwindow.ui', self)
|
||||
self.setWindowIcon(QtGui.QIcon('app.png'))
|
||||
uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'taggerwindow.ui' ), self)
|
||||
self.setWindowIcon(QtGui.QIcon(os.path.join(ComicTaggerSettings.baseDir(), 'app.png' )))
|
||||
|
||||
self.lblCover.setPixmap(QtGui.QPixmap(os.getcwd() + "/nocover.png"))
|
||||
self.lblCover.setPixmap(QtGui.QPixmap(os.path.join(ComicTaggerSettings.baseDir(), 'nocover.png' )))
|
||||
self.center()
|
||||
self.show()
|
||||
self.raise_()
|
||||
|
||||
#print platform.system(), platform.release()
|
||||
|
12
todo.txt
12
todo.txt
@ -5,11 +5,13 @@ Features
|
||||
|
||||
Toolbar icons
|
||||
|
||||
Infobox needs fixing up
|
||||
|
||||
Page Browser, mode-less dialog
|
||||
|
||||
Multi-match dialog
|
||||
|
||||
More auto-select logic using
|
||||
More auto-select logic using metadata
|
||||
|
||||
Stand-alone CLI
|
||||
Info dump
|
||||
@ -37,6 +39,8 @@ Version 2 - GUI to handle mutliple files or folders
|
||||
-----------------
|
||||
Bugs
|
||||
----------------
|
||||
SERIOUS BUG: rebuilding zips!
|
||||
http://stackoverflow.com/questions/11578443/trigger-io-errno-18-cross-device-link
|
||||
|
||||
Be more tolerant of mis-labled extensions i.e. cbr when it's a cbz
|
||||
|
||||
@ -111,3 +115,9 @@ Some that seem library only:
|
||||
Proposed Values
|
||||
Community Rating
|
||||
|
||||
Mac Notes:
|
||||
|
||||
python ~/pyinstaller-2.0/pyinstaller.py tagger.py -w -i windows/nsis/app.ico
|
||||
|
||||
|
||||
|
||||
|
@ -32,6 +32,7 @@ from issueidentifier import IssueIdentifier
|
||||
from genericmetadata import GenericMetadata
|
||||
from imagefetcher import ImageFetcher
|
||||
from progresswindow import IDProgressWindow
|
||||
from settings import ComicTaggerSettings
|
||||
|
||||
|
||||
class SearchThread( QtCore.QThread):
|
||||
@ -84,7 +85,7 @@ class VolumeSelectionWindow(QtGui.QDialog):
|
||||
def __init__(self, parent, cv_api_key, series_name, issue_number, comic_archive, settings):
|
||||
super(VolumeSelectionWindow, self).__init__(parent)
|
||||
|
||||
uic.loadUi('volumeselectionwindow.ui', self)
|
||||
uic.loadUi(os.path.join(ComicTaggerSettings.baseDir(), 'volumeselectionwindow.ui' ), self)
|
||||
|
||||
self.settings = settings
|
||||
self.series_name = series_name
|
||||
@ -271,8 +272,8 @@ class VolumeSelectionWindow(QtGui.QDialog):
|
||||
|
||||
self.teDetails.setText ( record['description'] )
|
||||
|
||||
self.labelThumbnail.setPixmap(QtGui.QPixmap(os.getcwd() + "/nocover.png"))
|
||||
|
||||
self.labelThumbnail.setPixmap(QtGui.QPixmap(os.path.join(ComicTaggerSettings.baseDir(), 'nocover.png' )))
|
||||
|
||||
url = record['image']['super_url']
|
||||
self.fetcher = ImageFetcher( )
|
||||
self.fetcher.fetchComplete.connect(self.finishRequest)
|
||||
|
Loading…
x
Reference in New Issue
Block a user