[Chandler-dev] Resolving import dependencies
Bryan Stearns
stearns at osafoundation.org
Fri Aug 11 17:10:24 PDT 2006
OK, I've moved the detail parcel from framework/blocks/detail to
views/detail. I think all the places that had to change, have.
(I'd wanted to do a bunch of cleanup of includes as part of this, but
I'm holding off, partly because I'd wanted to change from "from
osaf.framework.blocks import *" but got confused by the implications of
framework.blocks doing "from Block import Block as __Block" :-) )
...Bryan
Bryan Stearns wrote:
> osaf/framework/blocks/detail probably ought to move to osaf/views:
> it's really Chandler-specific, and not CPIA-generic. I've been meaning
> to do this, but it's not on my list anywhere. I'll do it shortly.
>
> ...Bryan
>
>
> Grant Baillie wrote:
>> Last week, Travis was trying to write some unit tests that were
>> failing miserably, and what it boiled down to was that there are at
>> least a couple of cases where parcels can't be loaded on their own.
>> For example, if you load up "osaf.views.main" via:
>>
>> ./release/RunPython tools/headless.py --profile /tmp/profile -a
>> osaf.views.main --create
>>
>> then you get:
>>
>> File "/Users/grant/src/chandler/application/schema.py", line 1245,
>> in _init_schema_item
>> module.installParcel(item, None)
>> File
>> "/Users/grant/src/chandler/parcels/osaf/views/main/__init__.py", line
>> 31, in installParcel
>> makeSummaryBlocks (parcel)
>> File
>> "/Users/grant/src/chandler/parcels/osaf/views/main/summaryblocks.py",
>> line 37, in makeSummaryBlocks
>> detailBranchPointDelegate = detail.DetailBranchPointDelegate.update(
>> NameError: global name 'detail' is not defined
>>
>> It turns out that summaryblocks.py expects detail to get defined by
>> the import at line 16:
>>
>> from osaf.framework.blocks import *
>>
>> but somehow (I guess because detail is a package, not a module) that
>> hasn't happened at the time the above code is called.
>>
>> So, my question is, what's the "right" fix here? One somewhat cheesy
>> way was to add "from osaf.framework.blocks import detail" below the *
>> import in summaryblocks.py.
>>
>> --Grant
>>
>>
>> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>>
>> Open Source Applications Foundation "chandler-dev" mailing list
>> http://lists.osafoundation.org/mailman/listinfo/chandler-dev
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "chandler-dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/chandler-dev
More information about the chandler-dev
mailing list