diff options
author | kali <kali@leap.se> | 2012-08-27 05:13:29 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-27 05:13:29 +0900 |
commit | c2786de7d2d09d600fa516f93cc1a1f851f0d705 (patch) | |
tree | 8b14f3b74b7f9e506fb77eb9826a0c4843507667 /src/leap/base/providers.py | |
parent | c2955d9655e3e7ccb3c5fc9e7d00a0d493d48a40 (diff) |
make provider-fetch tests pass
test provider-definition dump functions.
refactored the set-temp-to-home methods to setUpClass
separate provider-fetch tests on different testcases (so they actually
call to requests).
Diffstat (limited to 'src/leap/base/providers.py')
-rw-r--r-- | src/leap/base/providers.py | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/leap/base/providers.py b/src/leap/base/providers.py index 6fc050a0..1f6ab54b 100644 --- a/src/leap/base/providers.py +++ b/src/leap/base/providers.py @@ -1,3 +1,4 @@ +"""all dealing with leap-providers: definition files, updating""" import configuration from leap.base.config import JSONLeapConfig @@ -6,15 +7,24 @@ from leap.base.config import JSONLeapConfig # hacking in progress: # Specs are instances of configuration.Configuration class +# -yeah, that's an external app, not ours- # and have to carry an options attr. # # Configs have: -# - slug -# - definition +# - a slug (from where a filename/folder is derived) +# - a spec (for validation and defaults). + +# all config objects, as BaseConfig derived, implment basic +# useful methods: +# - save +# - load +# - get_config (returns a optparse.OptionParser object) # TODO: -# - have a good type cast repertory -# - raise validation errors? +# - have a good type cast repertory (uris, version, hashes...) +# - raise validation errors +# - multilingual objects + ########################################################## @@ -76,9 +86,17 @@ class LeapProviderDefinition(JSONLeapConfig): class LeapProvider(object): - # XXX ??? - # do we need this? - # can we hook here the network fetching stuff? + # bring slug here (property) + # constructor: pass name + + # constructor: init definition class + # (__cls__.__name__ + Definition) + # initializes a JSONLeapConfig with slug and + # initializes also cls.name + Spec + + # and Abstract this thing out! + + # how can we hook here the network fetching stuff? # maybe (bstorming a little bit): # config = LeapProviderDefinition @@ -87,5 +105,6 @@ class LeapProvider(object): class LeapProviderSet(object): + # we gather them from the filesystem def __init__(self): self.count = 0 |