2012-11-02 13:54:17 -07:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
"""
|
2012-11-06 12:56:30 -08:00
|
|
|
A python script to tag comic archives
|
|
|
|
"""
|
|
|
|
|
|
|
|
"""
|
|
|
|
Copyright 2012 Anthony Beville
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
2012-11-02 13:54:17 -07:00
|
|
|
"""
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import signal
|
2012-11-06 12:29:18 -08:00
|
|
|
import os
|
2012-11-14 17:25:01 -08:00
|
|
|
import traceback
|
|
|
|
import time
|
2012-11-19 12:28:19 -08:00
|
|
|
from pprint import pprint
|
|
|
|
import json
|
2012-11-27 16:33:51 -08:00
|
|
|
import platform
|
2012-11-06 12:29:18 -08:00
|
|
|
|
2012-11-27 09:59:08 -08:00
|
|
|
try:
|
2012-11-27 10:14:53 -08:00
|
|
|
qt_available = True
|
2012-11-27 09:59:08 -08:00
|
|
|
from PyQt4 import QtCore, QtGui
|
2012-11-27 10:14:53 -08:00
|
|
|
from taggerwindow import TaggerWindow
|
2012-11-29 18:14:06 -08:00
|
|
|
except ImportError as e:
|
2012-11-27 09:59:08 -08:00
|
|
|
qt_available = False
|
2012-11-29 22:03:15 -08:00
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
|
2012-11-10 11:02:38 -08:00
|
|
|
from settings import ComicTaggerSettings
|
2012-11-02 13:54:17 -07:00
|
|
|
from options import Options, MetaDataStyle
|
|
|
|
from comicarchive import ComicArchive
|
2012-11-10 11:02:38 -08:00
|
|
|
from issueidentifier import IssueIdentifier
|
2012-11-18 19:55:40 -08:00
|
|
|
from genericmetadata import GenericMetadata
|
2012-11-28 12:15:20 -08:00
|
|
|
from comicvinetalker import ComicVineTalker, ComicVineTalkerException
|
2012-12-03 17:16:58 -08:00
|
|
|
from issuestring import IssueString
|
2012-11-06 12:29:18 -08:00
|
|
|
import utils
|
2012-11-19 22:34:09 -08:00
|
|
|
import codecs
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
#-----------------------------
|
2012-11-10 12:29:07 -08:00
|
|
|
def cli_mode( opts, settings ):
|
2012-11-27 09:59:08 -08:00
|
|
|
if len( opts.file_list ) < 1:
|
|
|
|
print "You must specify at least one filename. Use the -h option for more info"
|
|
|
|
return
|
|
|
|
|
2012-11-18 21:15:16 -08:00
|
|
|
for f in opts.file_list:
|
|
|
|
process_file_cli( f, opts, settings )
|
2012-12-05 11:28:16 -08:00
|
|
|
sys.stdout.flush()
|
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
|
2012-12-03 17:16:58 -08:00
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
def create_local_metadata( opts, ca, has_desired_tags ):
|
2012-12-03 17:16:58 -08:00
|
|
|
|
|
|
|
md = GenericMetadata()
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
if has_desired_tags:
|
|
|
|
md = ca.readMetadata( opts.data_style )
|
2012-12-03 17:16:58 -08:00
|
|
|
|
|
|
|
# now, overlay the parsed filename info
|
|
|
|
if opts.parse_filename:
|
|
|
|
md.overlay( ca.metadataFromFilename() )
|
|
|
|
|
|
|
|
# finally, use explicit stuff
|
|
|
|
if opts.metadata is not None:
|
|
|
|
md.overlay( opts.metadata )
|
|
|
|
|
|
|
|
return md
|
|
|
|
|
2012-11-18 21:15:16 -08:00
|
|
|
def process_file_cli( filename, opts, settings ):
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
batch_mode = len( opts.file_list ) > 1
|
|
|
|
|
2012-11-18 21:15:16 -08:00
|
|
|
ca = ComicArchive(filename)
|
2012-11-18 17:01:17 -08:00
|
|
|
if settings.rar_exe_path != "":
|
|
|
|
ca.setExternalRarProgram( settings.rar_exe_path )
|
|
|
|
|
2012-11-07 09:29:45 -08:00
|
|
|
if not ca.seemsToBeAComicArchive():
|
2012-11-18 21:15:16 -08:00
|
|
|
print "Sorry, but "+ filename + " is not a comic archive!"
|
2012-11-07 09:29:45 -08:00
|
|
|
return
|
2012-11-18 19:55:40 -08:00
|
|
|
|
2012-11-25 20:09:11 -08:00
|
|
|
#if not ca.isWritableForStyle( opts.data_style ) and ( opts.delete_tags or opts.save_tags or opts.rename_file ):
|
2012-12-05 14:15:43 -08:00
|
|
|
if not ca.isWritable( ) and ( opts.delete_tags or opts.copy_tags or opts.save_tags or opts.rename_file ):
|
2012-11-20 13:20:26 -08:00
|
|
|
print "This archive is not writable for that tag type"
|
2012-11-18 19:55:40 -08:00
|
|
|
return
|
2012-11-18 17:01:17 -08:00
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
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
|
2012-11-18 17:01:17 -08:00
|
|
|
|
|
|
|
if opts.print_tags:
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
|
2012-11-18 17:01:17 -08:00
|
|
|
if opts.data_style is None:
|
|
|
|
page_count = ca.getNumberOfPages()
|
|
|
|
|
|
|
|
brief = ""
|
2012-12-03 20:02:16 -08:00
|
|
|
|
|
|
|
if batch_mode:
|
|
|
|
brief = "{0}: ".format(filename)
|
|
|
|
|
|
|
|
if ca.isZip(): brief += "ZIP archive "
|
|
|
|
elif ca.isRar(): brief += "RAR archive "
|
|
|
|
elif ca.isFolder(): brief += "Folder archive "
|
2012-11-18 17:01:17 -08:00
|
|
|
|
|
|
|
brief += "({0: >3} pages)".format(page_count)
|
|
|
|
brief += " tags:[ "
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
if not ( has[ MetaDataStyle.CBI ] or has[ MetaDataStyle.CIX ] or has[ MetaDataStyle.COMET ] ):
|
2012-11-25 20:09:11 -08:00
|
|
|
brief += "none "
|
2012-11-18 17:01:17 -08:00
|
|
|
else:
|
2012-12-03 20:02:16 -08:00
|
|
|
if has[ MetaDataStyle.CBI ]: brief += "CBL "
|
|
|
|
if has[ MetaDataStyle.CIX ]: brief += "CR "
|
|
|
|
if has[ MetaDataStyle.COMET ]: brief += "CoMet "
|
2012-11-18 17:01:17 -08:00
|
|
|
brief += "]"
|
|
|
|
|
|
|
|
print brief
|
2012-12-03 21:27:32 -08:00
|
|
|
|
|
|
|
if opts.terse:
|
|
|
|
return
|
|
|
|
|
|
|
|
print
|
|
|
|
|
2012-11-18 17:01:17 -08:00
|
|
|
if opts.data_style is None or opts.data_style == MetaDataStyle.CIX:
|
2012-12-03 20:02:16 -08:00
|
|
|
if has[ MetaDataStyle.CIX ]:
|
2012-11-18 17:01:17 -08:00
|
|
|
print "------ComicRack tags--------"
|
2012-11-19 12:28:19 -08:00
|
|
|
if opts.raw:
|
2012-11-19 22:34:09 -08:00
|
|
|
print u"{0}".format(ca.readRawCIX())
|
2012-11-19 12:28:19 -08:00
|
|
|
else:
|
2012-11-19 22:34:09 -08:00
|
|
|
print u"{0}".format(ca.readCIX())
|
2012-11-19 11:57:16 -08:00
|
|
|
|
2012-11-18 17:01:17 -08:00
|
|
|
if opts.data_style is None or opts.data_style == MetaDataStyle.CBI:
|
2012-12-03 20:02:16 -08:00
|
|
|
if has[ MetaDataStyle.CBI ]:
|
2012-11-18 17:01:17 -08:00
|
|
|
print "------ComicBookLover tags--------"
|
2012-11-19 12:28:19 -08:00
|
|
|
if opts.raw:
|
|
|
|
pprint(json.loads(ca.readRawCBI()))
|
|
|
|
else:
|
2012-11-19 22:34:09 -08:00
|
|
|
print u"{0}".format(ca.readCBI())
|
2012-12-02 12:17:39 -08:00
|
|
|
|
|
|
|
if opts.data_style is None or opts.data_style == MetaDataStyle.COMET:
|
2012-12-03 20:02:16 -08:00
|
|
|
if has[ MetaDataStyle.COMET ]:
|
2012-12-02 12:17:39 -08:00
|
|
|
print "------CoMet tags--------"
|
|
|
|
if opts.raw:
|
|
|
|
print u"{0}".format(ca.readRawCoMet())
|
|
|
|
else:
|
|
|
|
print u"{0}".format(ca.readCoMet())
|
2012-11-18 17:01:17 -08:00
|
|
|
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
elif opts.delete_tags:
|
|
|
|
style_name = MetaDataStyle.name[ opts.data_style ]
|
|
|
|
if has[ opts.data_style ]:
|
|
|
|
if not opts.dryrun:
|
|
|
|
if not ca.removeMetadata( opts.data_style ):
|
|
|
|
print "{0}: Tag removal seemed to fail!".format( filename )
|
2012-12-02 12:17:39 -08:00
|
|
|
else:
|
2012-12-03 20:02:16 -08:00
|
|
|
print "{0}: Removed {1} tags.".format( filename, style_name )
|
2012-12-02 12:17:39 -08:00
|
|
|
else:
|
2012-12-03 20:02:16 -08:00
|
|
|
print "{0}: dry-run. {1} tags not removed".format( filename, style_name )
|
|
|
|
else:
|
2012-12-05 11:28:16 -08:00
|
|
|
print "{0}: This archive doesn't have {1} tags to remove.".format( filename, style_name )
|
|
|
|
|
|
|
|
elif opts.copy_tags:
|
|
|
|
dst_style_name = MetaDataStyle.name[ opts.data_style ]
|
|
|
|
if opts.no_overwrite and has[ opts.data_style ]:
|
|
|
|
print "{0}: Already has {1} tags. Not overwriting.".format(filename, dst_style_name)
|
|
|
|
return
|
|
|
|
if opts.copy_source == opts.data_style:
|
|
|
|
print "{0}: Destination and source are same: {1}. Nothing to do.".format(filename, dst_style_name)
|
|
|
|
return
|
|
|
|
|
|
|
|
src_style_name = MetaDataStyle.name[ opts.copy_source ]
|
|
|
|
if has[ opts.copy_source ]:
|
|
|
|
if not opts.dryrun:
|
|
|
|
md = ca.readMetadata( opts.copy_source )
|
|
|
|
if not ca.writeMetadata( md, opts.data_style ):
|
|
|
|
print "{0}: Tag copy seemed to fail!".format( filename )
|
|
|
|
else:
|
|
|
|
print "{0}: Copied {1} tags to {2} .".format( filename, src_style_name, dst_style_name )
|
|
|
|
else:
|
|
|
|
print "{0}: dry-run. {1} tags not copied".format( filename, src_style_name )
|
|
|
|
else:
|
|
|
|
print "{0}: This archive doesn't have {1} tags to copy.".format( filename, src_style_name )
|
|
|
|
|
2012-11-10 12:29:07 -08:00
|
|
|
|
2012-11-18 17:01:17 -08:00
|
|
|
elif opts.save_tags:
|
2012-12-03 20:02:16 -08:00
|
|
|
|
2012-12-05 11:28:16 -08:00
|
|
|
if opts.no_overwrite and has[ opts.data_style ]:
|
|
|
|
print "{0}: Already has {1} tags. Not overwriting.".format(filename, MetaDataStyle.name[ opts.data_style ])
|
|
|
|
return
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
if batch_mode:
|
|
|
|
print "Processing {0}: ".format(filename)
|
|
|
|
|
|
|
|
md = create_local_metadata( opts, ca, has[ opts.data_style ] )
|
2012-11-02 13:54:17 -07:00
|
|
|
|
2012-12-03 17:16:58 -08:00
|
|
|
# now, search online
|
2012-11-18 19:55:40 -08:00
|
|
|
if opts.search_online:
|
|
|
|
|
2012-11-20 00:57:12 -08:00
|
|
|
ii = IssueIdentifier( ca, settings )
|
2012-11-18 17:01:17 -08:00
|
|
|
|
2012-11-18 19:55:40 -08:00
|
|
|
if md is None or md.isEmpty:
|
|
|
|
print "No metadata given to search online with!"
|
|
|
|
return
|
|
|
|
|
|
|
|
def myoutput( text ):
|
|
|
|
if opts.verbose:
|
|
|
|
IssueIdentifier.defaultWriteOutput( text )
|
|
|
|
|
|
|
|
# use our overlayed MD struct to search
|
|
|
|
ii.setAdditionalMetadata( md )
|
|
|
|
ii.onlyUseAdditionalMetaData = True
|
|
|
|
ii.setOutputFunction( myoutput )
|
|
|
|
matches = ii.search()
|
2012-11-18 17:01:17 -08:00
|
|
|
|
2012-11-18 19:55:40 -08:00
|
|
|
result = ii.search_result
|
|
|
|
|
|
|
|
found_match = False
|
|
|
|
choices = False
|
|
|
|
low_confidence = False
|
|
|
|
|
|
|
|
if result == ii.ResultNoMatches:
|
|
|
|
pass
|
|
|
|
elif result == ii.ResultFoundMatchButBadCoverScore:
|
2012-11-29 19:21:05 -08:00
|
|
|
low_confidence = True
|
2012-11-18 19:55:40 -08:00
|
|
|
found_match = True
|
|
|
|
elif result == ii.ResultFoundMatchButNotFirstPage :
|
|
|
|
found_match = True
|
|
|
|
elif result == ii.ResultMultipleMatchesWithBadImageScores:
|
2012-11-18 21:15:16 -08:00
|
|
|
low_confidence = True
|
2012-11-18 19:55:40 -08:00
|
|
|
choices = True
|
|
|
|
elif result == ii.ResultOneGoodMatch:
|
|
|
|
found_match = True
|
|
|
|
elif result == ii.ResultMultipleGoodMatches:
|
|
|
|
choices = True
|
|
|
|
|
|
|
|
if choices:
|
|
|
|
print "Online search: Multiple matches. Save aborted"
|
|
|
|
return
|
2012-11-29 19:21:05 -08:00
|
|
|
if low_confidence and opts.abortOnLowConfidence:
|
2012-11-18 19:55:40 -08:00
|
|
|
print "Online search: Low confidence match. Save aborted"
|
|
|
|
return
|
|
|
|
if not found_match:
|
|
|
|
print "Online search: No match found. Save aborted"
|
|
|
|
return
|
2012-11-18 17:01:17 -08:00
|
|
|
|
2012-11-18 19:55:40 -08:00
|
|
|
# we got here, so we have a single match
|
|
|
|
|
|
|
|
# now get the particular issue data
|
2012-11-28 12:15:20 -08:00
|
|
|
try:
|
2012-12-04 16:51:30 -08:00
|
|
|
cv_md = ComicVineTalker().fetchIssueData( matches[0]['volume_id'], matches[0]['issue_number'], settings.assume_lone_credit_is_primary )
|
2012-11-28 12:15:20 -08:00
|
|
|
except ComicVineTalkerException:
|
|
|
|
print "Network error while getting issue details. Save aborted"
|
|
|
|
return
|
2012-11-18 19:55:40 -08:00
|
|
|
|
|
|
|
md.overlay( cv_md )
|
|
|
|
# ok, done building our metadata. time to save
|
2012-11-18 17:01:17 -08:00
|
|
|
|
2012-11-18 19:55:40 -08:00
|
|
|
#HACK
|
2012-11-29 19:21:05 -08:00
|
|
|
#opts.dryrun = True
|
2012-11-18 19:55:40 -08:00
|
|
|
#HACK
|
|
|
|
|
|
|
|
if not opts.dryrun:
|
|
|
|
# write out the new data
|
2012-11-27 16:33:51 -08:00
|
|
|
if not ca.writeMetadata( md, opts.data_style ):
|
|
|
|
print "The tag save seemed to fail!"
|
|
|
|
else:
|
|
|
|
print "Save complete."
|
2012-11-18 19:55:40 -08:00
|
|
|
else:
|
|
|
|
print "dry-run option was set, so nothing was written, but here is the final set of tags:"
|
|
|
|
print u"{0}".format(md)
|
|
|
|
|
2012-11-27 10:55:31 -08:00
|
|
|
elif opts.rename_file:
|
|
|
|
|
2012-12-03 20:02:16 -08:00
|
|
|
msg_hdr = ""
|
|
|
|
if batch_mode:
|
|
|
|
msg_hdr = "{0}: ".format(filename)
|
|
|
|
|
|
|
|
if opts.data_style is not None:
|
|
|
|
use_tags = has[ opts.data_style ]
|
|
|
|
else:
|
|
|
|
use_tags = False
|
|
|
|
|
|
|
|
md = create_local_metadata( opts, ca, use_tags )
|
2012-12-02 12:17:39 -08:00
|
|
|
|
2012-11-27 10:55:31 -08:00
|
|
|
# TODO move this to ComicArchive, or maybe another class???
|
|
|
|
new_name = ""
|
|
|
|
if md.series is not None:
|
|
|
|
new_name += "{0}".format( md.series )
|
|
|
|
else:
|
2012-12-03 20:02:16 -08:00
|
|
|
print msg_hdr + "Can't rename without series name"
|
2012-11-27 10:55:31 -08:00
|
|
|
return
|
|
|
|
|
|
|
|
if md.volume is not None:
|
|
|
|
new_name += " v{0}".format( md.volume )
|
|
|
|
|
|
|
|
if md.issue is not None:
|
2012-12-03 17:16:58 -08:00
|
|
|
new_name += " #{0}".format( IssueString(md.issue).asString(pad=3) )
|
2012-12-03 20:02:16 -08:00
|
|
|
#else:
|
|
|
|
# print msg_hdr + "Can't rename without issue number"
|
|
|
|
# return
|
2012-11-27 10:55:31 -08:00
|
|
|
|
|
|
|
if md.issueCount is not None:
|
|
|
|
new_name += " (of {0})".format( md.issueCount )
|
|
|
|
|
|
|
|
if md.year is not None:
|
|
|
|
new_name += " ({0})".format( md.year )
|
|
|
|
|
2012-11-27 16:33:51 -08:00
|
|
|
if ca.isZip():
|
2012-11-27 10:55:31 -08:00
|
|
|
new_name += ".cbz"
|
|
|
|
elif ca.isRar():
|
|
|
|
new_name += ".cbr"
|
|
|
|
|
2012-11-29 19:21:05 -08:00
|
|
|
if new_name == os.path.basename(filename):
|
2012-12-03 20:02:16 -08:00
|
|
|
print msg_hdr + "Filename is already good!"
|
2012-11-29 19:21:05 -08:00
|
|
|
return
|
|
|
|
|
|
|
|
folder = os.path.dirname( os.path.abspath( filename ) )
|
|
|
|
new_abs_path = utils.unique_file( os.path.join( folder, new_name ) )
|
|
|
|
|
2012-11-27 10:55:31 -08:00
|
|
|
#HACK
|
2012-11-29 19:21:05 -08:00
|
|
|
#opts.dryrun = True
|
2012-12-03 17:16:58 -08:00
|
|
|
#HACK
|
|
|
|
|
|
|
|
suffix = ""
|
2012-11-27 10:55:31 -08:00
|
|
|
if not opts.dryrun:
|
2012-11-29 19:21:05 -08:00
|
|
|
# rename the file
|
|
|
|
os.rename( filename, new_abs_path )
|
2012-11-27 10:55:31 -08:00
|
|
|
else:
|
2012-12-03 17:16:58 -08:00
|
|
|
suffix = " (dry-run, no change)"
|
|
|
|
|
|
|
|
print "renamed '{0}' -> '{1}' {2}".format(os.path.basename(filename), new_name, suffix)
|
2012-11-27 10:55:31 -08:00
|
|
|
|
2012-11-18 19:55:40 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
#-----------------------------
|
|
|
|
|
|
|
|
def main():
|
2012-11-19 22:34:09 -08:00
|
|
|
|
|
|
|
# try to make stdout encodings happy for unicode
|
|
|
|
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
|
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
opts = Options()
|
|
|
|
opts.parseCmdLineArgs()
|
2012-11-09 13:04:33 -08:00
|
|
|
|
2012-11-06 12:29:18 -08:00
|
|
|
settings = ComicTaggerSettings()
|
|
|
|
# make sure unrar program is in the path for the UnRAR class
|
|
|
|
utils.addtopath(os.path.dirname(settings.unrar_exe_path))
|
2012-11-02 13:54:17 -07:00
|
|
|
|
2012-11-20 14:38:44 -08:00
|
|
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
2012-11-02 13:54:17 -07:00
|
|
|
|
2012-11-29 19:21:05 -08:00
|
|
|
if not qt_available and not opts.no_gui:
|
2012-11-27 09:59:08 -08:00
|
|
|
opts.no_gui = True
|
2012-11-29 19:21:05 -08:00
|
|
|
print "QT is not available."
|
2012-11-27 09:59:08 -08:00
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
if opts.no_gui:
|
2012-11-10 12:29:07 -08:00
|
|
|
cli_mode( opts, settings )
|
2012-11-02 13:54:17 -07:00
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
2012-11-12 16:12:43 -08:00
|
|
|
|
2012-11-27 16:33:51 -08:00
|
|
|
if platform.system() != "Linux":
|
|
|
|
img = QtGui.QPixmap(os.path.join(ComicTaggerSettings.baseDir(), 'graphics/tags.png' ))
|
|
|
|
splash = QtGui.QSplashScreen(img)
|
|
|
|
splash.show()
|
|
|
|
splash.raise_()
|
|
|
|
app.processEvents()
|
|
|
|
|
2012-11-14 17:25:01 -08:00
|
|
|
try:
|
2012-11-18 17:01:17 -08:00
|
|
|
tagger_window = TaggerWindow( opts.filename, settings )
|
2012-11-14 17:25:01 -08:00
|
|
|
tagger_window.show()
|
2012-11-27 16:33:51 -08:00
|
|
|
|
|
|
|
if platform.system() != "Linux":
|
|
|
|
splash.finish( tagger_window )
|
|
|
|
|
2012-11-14 17:25:01 -08:00
|
|
|
sys.exit(app.exec_())
|
|
|
|
except Exception, e:
|
|
|
|
QtGui.QMessageBox.critical(QtGui.QMainWindow(), "Error", "Unhandled exception in app:\n" + traceback.format_exc() )
|
|
|
|
|
|
|
|
|
2012-11-02 13:54:17 -07:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|