From 017e483b5a8f873877d0fba1642fdf91103f487f Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 15 Jan 2012 11:00:34 -0500 Subject: [PATCH] Re-added error handling. --HG-- branch : objp --- build.py | 13 ++++++++++--- cocoa/inter/app.py | 1 + cocoa/se/dupeguru.xcodeproj/project.pbxproj | 6 ------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index 748a73cb..9b3f85e5 100644 --- a/build.py +++ b/build.py @@ -30,6 +30,8 @@ def parse_args(): help="Build only the help file") parser.add_option('--loc', action='store_true', dest='loc', help="Build only localization") + parser.add_option('--cocoamod', action='store_true', dest='cocoamod', + help="Build only Cocoa modules") parser.add_option('--updatepot', action='store_true', dest='updatepot', help="Generate .pot files from source code.") parser.add_option('--mergepot', action='store_true', dest='mergepot', @@ -165,11 +167,11 @@ def build_mergepot(): loc.merge_pots_into_pos('locale') loc.merge_pots_into_pos(op.join('hscommon', 'locale')) -def build_cocoa_ext(extname, dest, source_files, extra_frameworks=()): +def build_cocoa_ext(extname, dest, source_files, extra_frameworks=(), extra_includes=()): extra_link_args = ["-framework", "CoreFoundation", "-framework", "Foundation"] for extra in extra_frameworks: extra_link_args += ['-framework', extra] - ext = Extension(extname, source_files, extra_link_args=extra_link_args) + ext = Extension(extname, source_files, extra_link_args=extra_link_args, include_dirs=extra_includes) setup(script_args=['build_ext', '--inplace'], ext_modules=[ext]) fn = extname + '.so' assert op.exists(fn) @@ -180,7 +182,9 @@ def build_cocoa_proxy_module(): import objp.p2o objp.p2o.generate_python_proxy_code('cocoalib/cocoa/CocoaProxy.h', 'build/CocoaProxy.m') build_cocoa_ext("CocoaProxy", 'cocoalib/cocoa', - ['cocoalib/cocoa/CocoaProxy.m', 'build/CocoaProxy.m', 'build/ObjP.m'], ['AppKit']) + ['cocoalib/cocoa/CocoaProxy.m', 'build/CocoaProxy.m', 'build/ObjP.m', 'cocoalib/HSErrorReportWindow.m'], + ['AppKit', 'CoreServices'], + ['cocoalib']) def build_cocoa_bridging_interfaces(): print("Building Cocoa Bridging Interfaces") @@ -273,6 +277,9 @@ def main(): build_updatepot() elif options.mergepot: build_mergepot() + elif options.cocoamod: + build_cocoa_proxy_module() + build_cocoa_bridging_interfaces() else: build_normal(edition, ui, dev) diff --git a/cocoa/inter/app.py b/cocoa/inter/app.py index 371fe11b..a82de240 100644 --- a/cocoa/inter/app.py +++ b/cocoa/inter/app.py @@ -25,6 +25,7 @@ class DupeGuruView(FairwareView): class PyDupeGuruBase(PyFairware): FOLLOW_PROTOCOLS = ['Worker'] + @dontwrap def _init(self, modelclass): logging.basicConfig(level=logging.WARNING, format='%(levelname)s %(message)s') install_exception_hook() diff --git a/cocoa/se/dupeguru.xcodeproj/project.pbxproj b/cocoa/se/dupeguru.xcodeproj/project.pbxproj index f1d549c5..0587e7d3 100644 --- a/cocoa/se/dupeguru.xcodeproj/project.pbxproj +++ b/cocoa/se/dupeguru.xcodeproj/project.pbxproj @@ -77,7 +77,6 @@ CEF0ACCE12DF3C2000B32F7E /* HSRecentFiles.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF0ACCD12DF3C2000B32F7E /* HSRecentFiles.m */; }; CEFC294609C89E3D00D9F998 /* folder32.png in Resources */ = {isa = PBXBuildFile; fileRef = CEFC294509C89E3D00D9F998 /* folder32.png */; }; CEFC7F9E0FC9517500CD5728 /* Dialogs.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8B0FC9517500CD5728 /* Dialogs.m */; }; - CEFC7F9F0FC9517500CD5728 /* HSErrorReportWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */; }; CEFC7FA10FC9517500CD5728 /* ProgressController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F910FC9517500CD5728 /* ProgressController.m */; }; CEFC7FA50FC9517500CD5728 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F9B0FC9517500CD5728 /* Utils.m */; }; CEFC7FA60FC9517500CD5728 /* ValueTransformers.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFC7F9D0FC9517500CD5728 /* ValueTransformers.m */; }; @@ -291,8 +290,6 @@ CEFC294509C89E3D00D9F998 /* folder32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = folder32.png; path = ../../images/folder32.png; sourceTree = SOURCE_ROOT; }; CEFC7F8A0FC9517500CD5728 /* Dialogs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Dialogs.h; path = ../../cocoalib/Dialogs.h; sourceTree = SOURCE_ROOT; }; CEFC7F8B0FC9517500CD5728 /* Dialogs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Dialogs.m; path = ../../cocoalib/Dialogs.m; sourceTree = SOURCE_ROOT; }; - CEFC7F8C0FC9517500CD5728 /* HSErrorReportWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HSErrorReportWindow.h; path = ../../cocoalib/HSErrorReportWindow.h; sourceTree = SOURCE_ROOT; }; - CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HSErrorReportWindow.m; path = ../../cocoalib/HSErrorReportWindow.m; sourceTree = SOURCE_ROOT; }; CEFC7F900FC9517500CD5728 /* ProgressController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgressController.h; path = ../../cocoalib/ProgressController.h; sourceTree = SOURCE_ROOT; }; CEFC7F910FC9517500CD5728 /* ProgressController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProgressController.m; path = ../../cocoalib/ProgressController.m; sourceTree = SOURCE_ROOT; }; CEFC7F9A0FC9517500CD5728 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utils.h; path = ../../cocoalib/Utils.h; sourceTree = SOURCE_ROOT; }; @@ -527,8 +524,6 @@ CEB57990146ADC5100EDF7D7 /* HSConsts.h */, CEFC7F8A0FC9517500CD5728 /* Dialogs.h */, CEFC7F8B0FC9517500CD5728 /* Dialogs.m */, - CEFC7F8C0FC9517500CD5728 /* HSErrorReportWindow.h */, - CEFC7F8D0FC9517500CD5728 /* HSErrorReportWindow.m */, CE79638A12536F4E008D405B /* HSFairwareReminder.h */, CE79638B12536F4E008D405B /* HSFairwareReminder.m */, CE27D3C212CCA43800859E67 /* HSAboutBox.h */, @@ -675,7 +670,6 @@ CE381C9609914ACE003581CE /* AppDelegate.m in Sources */, CE381C9C09914ADF003581CE /* ResultWindow.m in Sources */, CEFC7F9E0FC9517500CD5728 /* Dialogs.m in Sources */, - CEFC7F9F0FC9517500CD5728 /* HSErrorReportWindow.m in Sources */, CEFC7FA10FC9517500CD5728 /* ProgressController.m in Sources */, CEFC7FA50FC9517500CD5728 /* Utils.m in Sources */, CEFC7FA60FC9517500CD5728 /* ValueTransformers.m in Sources */,