Closed Bug 659136 Opened 14 years ago Closed 14 years ago

Add lightweight function for dynamic startup time class loading

Categories

(Cloud Services :: Server: Core, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: telliott, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

Need to have the ability to do a bunch of dynamic class loading as we move to a less monolithic codebase, so: auth = load_and_configure(config, 'auth') reset = load_and_configure(config, 'reset') etc. thus, a lightweight function that can grab the value for 'backend' and return an instanciated class.
Attachment #534598 - Flags: review?(tarek)
Actually uploading the right file this time
Attachment #534598 - Attachment is obsolete: true
Attachment #534598 - Flags: review?(tarek)
Attachment #534599 - Flags: review?(tarek)
Comment on attachment 534599 [details] [diff] [review] Adds a function for dynamic class loading Review of attachment 534599 [details] [diff] [review]: ----------------------------------------------------------------- Looks good besides a small warning to fix: /home/tarek/dev/hg.mozilla.org/server-core/services/tests/test_pluginreg.py:76:41: E202 whitespace before '}'
Attachment #534599 - Flags: review?(tarek) → review+
Is that a problem in python? Because it's a heck of a lot easier to read that way
Technically it's similar. You can have as many empty lines you want before closing the dict. But we follow pep8, and use a tool to ensure this (flake8) that controls that the code is compliant. I agree that this is a edge, debatable case, but I prefer not to have any warnings and be sure that the code keeps on being pep8. On a personal note I don't think it's easier to read unless you come from another language ;) So I propose that we fix it for this one, but that we change flake8 to be relaxed on that case in the future.
uploaded in http://hg.mozilla.org/services/server-core/rev/d8798a5b4b57 You're lucky python doesn't use braces for flow control, or there's be a holy war about to happen! ;)
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: