Package cdbx :: Module _util
[frames] | no frames]

Source Code for Module cdbx._util

 1  # -*- coding: ascii -*- 
 2  r""" 
 3  :Copyright: 
 4   
 5   Copyright 2014 - 2016 
 6   Andr\xe9 Malo or his licensors, as applicable 
 7   
 8  :License: 
 9   
10   Licensed under the Apache License, Version 2.0 (the "License"); 
11   you may not use this file except in compliance with the License. 
12   You may obtain a copy of the License at 
13   
14       http://www.apache.org/licenses/LICENSE-2.0 
15   
16   Unless required by applicable law or agreed to in writing, software 
17   distributed under the License is distributed on an "AS IS" BASIS, 
18   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
19   See the License for the specific language governing permissions and 
20   limitations under the License. 
21   
22  ================ 
23   Misc Utilities 
24  ================ 
25   
26  Misc utilities. 
27  """ 
28  if __doc__: 
29      # pylint: disable = redefined-builtin 
30      __doc__ = __doc__.encode('ascii').decode('unicode_escape') 
31  __author__ = r"Andr\xe9 Malo".encode('ascii').decode('unicode_escape') 
32  __docformat__ = "restructuredtext en" 
33   
34   
35 -def find_public(space):
36 """ 37 Determine all public names in space 38 39 If the space contains an ``__all__`` sequence, a copy is returned (as a 40 list). Otherwise, all symbol names not starting with an underscore are 41 listed. 42 43 :Parameters: 44 `space` : ``dict`` 45 Name space to inspect 46 47 :Return: List of public names 48 :Rtype: ``list`` 49 """ 50 if '__all__' in space: 51 return list(space['__all__']) 52 return [key for key in space.keys() if not key.startswith('_')]
53