Changeset 12060 for main/waeup.ikoba
- Timestamp:
- 25 Nov 2014, 18:44:01 (10 years ago)
- Location:
- main/waeup.ikoba/trunk
- Files:
-
- 1 deleted
- 15 edited
- 9 copied
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk
- Property svn:mergeinfo changed
/main/waeup.ikoba/branches/uli-payments (added) merged: 11970,11991-11994,11998-12003,12010-12014,12019,12021-12027,12029-12031,12041-12045
- Property svn:mergeinfo changed
-
main/waeup.ikoba/trunk/docs/INSTALL.txt
r11954 r12060 1 1 Installation of Ikoba 2 #################### 2 ##################### 3 3 4 4 These are generic installation instructions for the WAeUP_ ``Ikoba`` … … 8 8 file. 9 9 10 Please note, that **only Linux-based installs** are described and actively11 supported. We recommend use of Debian_ / Ubuntu_.10 Please note, that **only Linux-based installs** are described and 11 actively supported. We recommend use of Debian_ / Ubuntu_. 12 12 13 13 .. note:: This means we do not actively support Windows(tm)! … … 19 19 ************* 20 20 21 The Ikoba packages are based on `Grok`_, which is a Python_ 22 f ramework for agile webapplication development. Grok_ itself is based23 on`Zope`_.21 The Ikoba packages are based on `Grok`_, which is a Python_ framework 22 for agile webapplication development. Grok_ itself is based on 23 `Zope`_. 24 24 25 25 Both, Grok_ and Zope_, are written in the `Python`_ programming … … 46 46 * XML and XSLT development libraries (``libxml2-dev``, ``libxslt1-dev``) 47 47 48 * The "Foreign Function Interface Library" (FFI, ``libffi-dev``) because 49 it is needed by the paypal Python SDK 50 48 51 * enscript (``enscript``) [optional] 49 52 … … 53 56 54 57 $ sudo apt-get install python2.7 python2.7-dev subversion \ 55 build-essential enscript libxml2-dev libxslt1-dev 58 build-essential enscript libxml2-dev libxslt1-dev \ 59 libffi-dev 56 60 57 61 Afterwards you should be able to enter:: -
main/waeup.ikoba/trunk/docs/source/developerdocs/api/api_meta.rst
r11949 r12060 1 1 `meta` -- Ikoba Components Grokkers Module 2 ***************************************** 2 ****************************************** 3 3 4 4 .. automodule:: waeup.ikoba.meta -
main/waeup.ikoba/trunk/docs/source/developerdocs/api/api_payments.rst
r11949 r12060 18 18 :maxdepth: 1 19 19 20 payments/api_payment21 20 payments/api_container 22 21 payments/api_interfaces 22 payments/api_payment 23 payments/api_paypal -
main/waeup.ikoba/trunk/etc
-
Property
svn:ignore
set to
paypal.conf
paypal-testing.conf
-
Property
svn:ignore
set to
-
main/waeup.ikoba/trunk/etc/site.zcml.in
r11949 r12060 27 27 <ikoba:datacenter 28 28 path="${buildout:directory}/var/datacenter" /> 29 30 <!-- Where can the Paypal config be found? --> 31 <ikoba:paypalconf 32 path="${buildout:directory}/etc/paypal.conf" /> 29 33 30 34 <configure i18n_domain="${ikoba_params:devel_pkg}"> -
main/waeup.ikoba/trunk/setup.py
r11954 r12060 41 41 'zc.async[z3]', 42 42 'z3c.evalexception', 43 'paypalrestsdk', 43 44 ], 44 45 -
main/waeup.ikoba/trunk/src/waeup/ikoba
- Property svn:mergeinfo changed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/ftesting.zcml
r11949 r12060 14 14 <ikoba:datacenter 15 15 path="../../../parts/test/datacenter" /> 16 17 <!-- Where can the Paypal config be found? --> 18 <ikoba:paypalconf 19 path="../../../etc/paypal-testing.conf" /> 16 20 17 21 <!-- Typical functional testing security setup --> -
main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py
r12032 r12060 1137 1137 ) 1138 1138 1139 1140 class IPayPalConfig(Interface): 1141 path = Path( 1142 title = u'Path', 1143 description = u"Path to config file for PayPal REST API.", 1144 required = True, 1145 ) 1146 1147 1139 1148 # 1140 1149 # Asynchronous job handling and related -
main/waeup.ikoba/trunk/src/waeup/ikoba/meta.zcml
r11949 r12060 17 17 /> 18 18 19 <meta:directive 20 namespace="http://namespaces.waeup.org/ikoba" 21 name="paypalconf" 22 schema=".zcml.IPayPalConfig" 23 handler=".zcml.paypal_conf" 24 /> 19 25 20 26 </configure> -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/tests/test_utils.py
r11997 r12060 29 29 30 30 def setUp(self): 31 self.max_pmem = psutil.phymem_usage().total32 31 self.max_vmem = psutil.virtual_memory().total 33 32 self.max_smem = psutil.swap_memory().total … … 124 123 utils.SYSTEM_MAX_LOAD['virt-mem'] = -(sys.maxint) # negative int 125 124 assert utils.expensive_actions_allowed() == False 126 127 def test_expensive_actions_allowed_physmem_none(self):128 # unset physmem maximum values make KofUtils ignore physmem values129 utils = self.get_cleared_util()130 utils.SYSTEM_MAX_LOAD['phys-mem'] = None131 assert utils.expensive_actions_allowed() == True132 # even not-set values won't block us133 del utils.SYSTEM_MAX_LOAD['phys-mem']134 assert utils.expensive_actions_allowed() == True135 136 @unittest.skipIf(137 psutil.phymem_usage().percent >= 99.99,138 reason="System physmem use over 99%. Cannot set higher allowed value.")139 def test_expensive_actions_allowed_physmem_ok(self):140 # We can react to high physmem values141 max_mem = psutil.phymem_usage().total142 utils = self.get_cleared_util()143 utils.SYSTEM_MAX_LOAD['phys-mem'] = 99.99 # positive float144 assert utils.expensive_actions_allowed() == True145 utils.SYSTEM_MAX_LOAD['phys-mem'] = -0.01 # negative float146 assert utils.expensive_actions_allowed() == True147 utils.SYSTEM_MAX_LOAD['phys-mem'] = max_mem # positive int148 assert utils.expensive_actions_allowed() == True149 utils.SYSTEM_MAX_LOAD['phys-mem'] = -1 # negative int150 assert utils.expensive_actions_allowed() == True151 152 @unittest.skipIf(153 not psutil.phymem_usage().percent,154 reason="Can test physmem behavior only if actually using some")155 def test_expensive_actions_allowed_physmem_too_much(self):156 # We can react if too much physmem is used157 max_mem = psutil.phymem_usage().total158 utils = self.get_cleared_util()159 utils.SYSTEM_MAX_LOAD['phys-mem'] = 0.0 # positive float160 assert utils.expensive_actions_allowed() == False161 utils.SYSTEM_MAX_LOAD['phys-mem'] = -100.0 # negative float162 assert utils.expensive_actions_allowed() == False163 utils.SYSTEM_MAX_LOAD['phys-mem'] = 0 # positive int164 assert utils.expensive_actions_allowed() == False165 utils.SYSTEM_MAX_LOAD['phys-mem'] = -(max_mem) # negative int166 assert utils.expensive_actions_allowed() == False -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py
r12053 r12060 125 125 #: value. `cpu-load`, of course, accepts float values only. 126 126 #: `swap-mem` = Swap Memory, `virt-mem` = Virtual Memory, 127 #: ` phys-mem` = Physical Memory, `cpu-load` = CPU load in percent.127 #: `cpu-load` = CPU load in percent. 128 128 SYSTEM_MAX_LOAD = { 129 129 'swap-mem': None, 130 130 'virt-mem': None, 131 'phys-mem': None,132 131 'cpu-load': 100.0, 133 132 } … … 247 246 ('swap-mem', psutil.swap_memory), 248 247 ('virt-mem', psutil.virtual_memory), 249 ('phys-mem', psutil.phymem_usage),250 248 ): 251 249 max_val = max_values.get(key, None) -
main/waeup.ikoba/trunk/src/waeup/ikoba/zcml.py
r11949 r12060 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 import os 18 19 from zope.component.zcml import handler 19 from waeup.ikoba.interfaces import IDataCenterConfig 20 from zope.configuration.exceptions import ConfigurationError 21 from waeup.ikoba.interfaces import IDataCenterConfig, IPayPalConfig 22 from waeup.ikoba.payments.paypal import configure_sdk 23 20 24 21 25 def data_center_conf(context, path): … … 44 48 """ 45 49 context.action( 46 discriminator =('utility', IDataCenterConfig, ''),47 callable =handler,48 args =('registerUtility',49 {'path':path}, IDataCenterConfig, '')50 discriminator=('utility', IDataCenterConfig, ''), 51 callable=handler, 52 args=('registerUtility', 53 {'path': path}, IDataCenterConfig, '') 50 54 ) 55 56 57 def paypal_handler(path): 58 """ZCML handler that registers paypal configuration. 59 60 We expect paypal credentials written down in a config file. The 61 path to this config file can be set with the ZCML `paypalconf` 62 directive, which is handled here and looks like this:: 63 64 <ikoba:paypalconf path='/some/path/to/paypal.conf' /> 65 66 This handler requires the given path to exist and to be a file. 67 68 If the file exists and is readable, a dict with ``path`` and other 69 values read from the configuration file is registered as a global 70 unnamed utility for the `IPayPalConfig` interface. 71 72 See :func:`waeup.ikoba.payments.paypal.configure_sdk for details 73 of the set dict. 74 """ 75 if not os.path.exists(path): 76 raise ConfigurationError("No such file: %s" % path) 77 if not os.path.isfile(path): 78 raise ConfigurationError("Not a regular file: %s" % path) 79 config_dict = configure_sdk(path) 80 return handler( 81 'registerUtility', config_dict, IPayPalConfig, '') 82 83 84 def paypal_conf(context, path): 85 """Handler for ZCML paypalconf directive. 86 87 This handler registers the `paypal_handler` above to perform the 88 real configuration action. 89 """ 90 context.action( 91 discriminator=('utility', IPayPalConfig, ''), 92 callable=paypal_handler, 93 args=(path, ) 94 ) -
main/waeup.ikoba/trunk/versions.cfg
r11949 r12060 7 7 8 8 [versions] 9 setuptools = 7.0 9 10 collective.recipe.sphinxbuilder = 0.7.0 10 11 collective.recipe.template = 1.10 … … 156 157 lxml = 3.3.1 157 158 158 # Added by buildout at 2014-09-19 13:29:39.427594159 160 159 # Required by: 161 160 # waeup.ikoba==1.3dev 162 161 psutil = 2.1.1 162 six = 1.5.2 163 # Added by buildout at 2014-11-18 17:09:18.443792 164 cffi = 0.8.6 165 cryptography = 0.6.1 166 pyOpenSSL = 0.14 167 168 # Required by: 169 # waeup.ikoba==0.2dev 170 paypalrestsdk = 1.6.1 171 172 # Required by: 173 # cffi==0.8.6 174 pycparser = 2.10 175 176 # Required by: 177 # paypalrestsdk==1.6.1 178 requests = 2.4.3
Note: See TracChangeset for help on using the changeset viewer.