Renamed tagger.py to comictagger.py
Added check for Qt libs, and run in CLI-only mode if not found git-svn-id: http://comictagger.googlecode.com/svn/trunk@90 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
parent
2c205a8488
commit
e37612ffeb
@ -28,7 +28,12 @@ import time
|
||||
from pprint import pprint
|
||||
import json
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
qt_available = True
|
||||
try:
|
||||
from PyQt4 import QtCore, QtGui
|
||||
except ImportError:
|
||||
qt_available = False
|
||||
|
||||
|
||||
from settings import ComicTaggerSettings
|
||||
from taggerwindow import TaggerWindow
|
||||
@ -43,6 +48,10 @@ import codecs
|
||||
|
||||
#-----------------------------
|
||||
def cli_mode( opts, settings ):
|
||||
if len( opts.file_list ) < 1:
|
||||
print "You must specify at least one filename. Use the -h option for more info"
|
||||
return
|
||||
|
||||
for f in opts.file_list:
|
||||
if len( opts.file_list ) > 1:
|
||||
print "Processing: ", f
|
||||
@ -50,8 +59,6 @@ def cli_mode( opts, settings ):
|
||||
|
||||
def process_file_cli( filename, opts, settings ):
|
||||
|
||||
if filename is None:
|
||||
return
|
||||
|
||||
ca = ComicArchive(filename)
|
||||
if settings.rar_exe_path != "":
|
||||
@ -212,7 +219,7 @@ def process_file_cli( filename, opts, settings ):
|
||||
# ok, done building our metadata. time to save
|
||||
|
||||
#HACK
|
||||
opts.dryrun = True
|
||||
#opts.dryrun = True
|
||||
#HACK
|
||||
|
||||
if not opts.dryrun:
|
||||
@ -243,8 +250,11 @@ def main():
|
||||
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
|
||||
if not qt_available:
|
||||
opts.no_gui = True
|
||||
print "QT is not available. Running in text mode"
|
||||
|
||||
if opts.no_gui:
|
||||
|
||||
cli_mode( opts, settings )
|
||||
|
||||
else:
|
@ -16,7 +16,7 @@ DMG_FILE := $(VOLUME_NAME).dmg
|
||||
all: clean dist diskimage
|
||||
|
||||
dist:
|
||||
$(PY2INSTALLER_CMD) $(TAGGER_BASE)/tagger.py -o $(MAC_BASE) -c -n $(APP_NAME) -s
|
||||
$(PY2INSTALLER_CMD) $(TAGGER_BASE)/comictagger.py -o $(MAC_BASE) -c -n $(APP_NAME) -s
|
||||
cp $(TAGGER_BASE)/*.ui $(APP_BUNDLE)/Contents/MacOS
|
||||
cp -a $(TAGGER_BASE)/graphics $(APP_BUNDLE)/Contents/MacOS
|
||||
cp $(MAC_BASE)/app.icns $(APP_BUNDLE)/Contents/Resources/icon-windowed.icns
|
||||
|
@ -10,7 +10,7 @@ all: clean dist package
|
||||
|
||||
dist:
|
||||
cd "$(TAGGER_BASE)" &
|
||||
"C:\Python27\Scripts\cxfreeze.bat" $(TAGGER_BASE)\tagger.py --icon nsis\app.ico
|
||||
"C:\Python27\Scripts\cxfreeze.bat" $(TAGGER_BASE)\comictagger.py --icon nsis\app.ico
|
||||
#--base-name=Win32GUI
|
||||
cp -R C:\Python27\Lib\site-packages\PyQt4\plugins\imageformats $(DIST_DIR)
|
||||
cp "$(TAGGER_BASE)\UnRAR2\UnRARDLL\unrar.dll" $(DIST_DIR)
|
||||
|
@ -123,11 +123,11 @@ Section "Install Section" SecInstall
|
||||
;Create shortcuts
|
||||
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\ComicTagger.lnk" "$INSTDIR\tagger.exe"
|
||||
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\ComicTagger.lnk" "$INSTDIR\comictagger.exe"
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
|
||||
CreateShortCut "$DESKTOP\ComicTagger.lnk" "$INSTDIR\tagger.exe" ""
|
||||
CreateShortCut "$DESKTOP\ComicTagger.lnk" "$INSTDIR\comictagger.exe" ""
|
||||
|
||||
|
||||
SectionEnd
|
||||
|
Loading…
Reference in New Issue
Block a user