Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 137 lines (97 sloc) 4.559 kB
b9c09f0 @KelSolaar Update "README" and "CHANGELOG" files.
authored
1 Foundations
2 ===========
3
4 .. image:: https://secure.travis-ci.org/KelSolaar/Foundations.png?branch=master
d5debfa @KelSolaar Update documentation theme.
authored
5 .. image:: https://gemnasium.com/KelSolaar/Foundations.png
cb20502 @KelSolaar Update "README.rst" file.
authored
6 .. image:: https://badge.waffle.io/kelsolaar/foundations.png?label=ready&title=Ready
7 :target: https://waffle.io/kelsolaar/foundations
8 :alt: 'Stories in Ready'
b9c09f0 @KelSolaar Update "README" and "CHANGELOG" files.
authored
9
10 Introduction
11 ------------
12
d95e120 @KelSolaar Update documentation / help files.
authored
13 **Foundations** is the core package of `Oncilla <http://github.com/KelSolaar/Oncilla>`_, `Color <http://github.com/KelSolaar/Color>`_, `Manager <http://github.com/KelSolaar/Manager>`_, `Umbra <http://github.com/KelSolaar/Umbra>`_, `sIBL_GUI <http://github.com/KelSolaar/sIBL_GUI>`_, `sIBL_Reporter <http://github.com/KelSolaar/sIBL_Reporter>`_.It provides modules defining various utilities objects used in those packages.
b9c09f0 @KelSolaar Update "README" and "CHANGELOG" files.
authored
14
4d64a88 @KelSolaar Update documentation files.
authored
15 Installation
16 ------------
17
bcff6dc @KelSolaar Update package dependencies.
authored
18 The following dependencies are needed:
19
2c527d9 @KelSolaar Raise package version number to 2.0.3.
authored
20 - **Python 2.6.7** or **Python 2.7.3**: http://www.python.org/
bcff6dc @KelSolaar Update package dependencies.
authored
21 - **PyQt**: http://www.riverbankcomputing.co.uk/
22
ad94d99 @KelSolaar Update various utilities and documentation files.
authored
23 To install **Foundations** from the `Python Package Index <http://pypi.python.org/pypi/Foundations>`_ you can issue this command in a shell::
24
25 pip install Foundations
26
27 or this alternative command::
28
29 easy_install Foundations
30
d95e120 @KelSolaar Update documentation / help files.
authored
31 You can also directly install from `Github <http://github.com/KelSolaar/Foundations>`_ source repository::
ad94d99 @KelSolaar Update various utilities and documentation files.
authored
32
33 git clone git://github.com/KelSolaar/Foundations.git
35e6204 @KelSolaar Update various helpers files.
authored
34 cd Foundations
ad94d99 @KelSolaar Update various utilities and documentation files.
authored
35 python setup.py install
36
bcff6dc @KelSolaar Update package dependencies.
authored
37 If you want to build the documentation you will also need:
38
39 - **Tidy** http://tidy.sourceforge.net/
40
4d64a88 @KelSolaar Update documentation files.
authored
41 Usage
42 -----
43
ad94d99 @KelSolaar Update various utilities and documentation files.
authored
44 Given the large spectrum of the objects defined in **Foundations** package, please refer to `Foundations - Api <http://thomasmansencal.com/Sharing/Foundations/Support/Documentation/Api/index.html>`_ for precise usage examples about each modules. Here are listed a few non exhaustive usage examples.
4d64a88 @KelSolaar Update documentation files.
authored
45
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
46 - **foundations.dataStructures.Structure**:
4d64a88 @KelSolaar Update documentation files.
authored
47
48 .. code:: python
49
50 >>> person = Structure(firstName="Doe", lastName="John", gender="male")
51 >>> person.firstName
52 'Doe'
53 >>> person.keys()
54 ['gender', 'firstName', 'lastName']
55 >>> person["gender"]
56 'male'
57 >>> del(person["gender"])
58 >>> person["gender"]
59 Traceback (most recent call last):
60 File "<console>", line 1, in <module>
61 KeyError: 'gender'
62 >>> person.gender
63 Traceback (most recent call last):
64 File "<console>", line 1, in <module>
65 AttributeError: 'Structure' object has no attribute 'gender'
66
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
67 - **foundations.dataStructures.Lookup**:
4d64a88 @KelSolaar Update documentation files.
authored
68
69 .. code:: python
70
71 >>> person = Lookup(firstName="Doe", lastName="John", gender="male")
72 >>> person.getFirstKeyFromValue("Doe")
73 'firstName'
74 >>> persons = foundations.foundations.dataStructures.Lookup(John="Doe", Jane="Doe", Luke="Skywalker")
75 >>> persons.getKeysFromValue("Doe")
76 ['Jane', 'John']
77
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
78 - **foundations.environment.Environment**:
4d64a88 @KelSolaar Update documentation files.
authored
79
80 .. code:: python
81
82 >>> environment = Environment(JOHN="DOE", DOE="JOHN")
83 >>> environment.setValues()
84 True
85 >>> import os
86 >>> os.environ["JOHN"]
87 'DOE'
88 >>> os.environ["DOE"]
89 'JOHN'
90
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
91 - **foundations.strings.getNiceName**:
4d64a88 @KelSolaar Update documentation files.
authored
92
93 .. code:: python
94
95 >>> getNiceName("getMeANiceName")
96 'Get Me A Nice Name'
97 >>> getNiceName("__getMeANiceName")
98 '__Get Me A Nice Name'
99
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
100 - **foundations.strings.getSplitextBasename**:
4d64a88 @KelSolaar Update documentation files.
authored
101
102 .. code:: python
103
104 >>> getSplitextBasename("/Users/JohnDoe/Documents/Test.txt")
105 'Test'
106
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
107 - **foundations.strings.getCommonPathsAncestor**:
4d64a88 @KelSolaar Update documentation files.
authored
108
109 .. code:: python
110
111 >>> getCommonPathsAncestor("/Users/JohnDoe/Documents", "/Users/JohnDoe/Documents/Test.txt")
112 '/Users/JohnDoe/Documents'
113
df84bf8 @KelSolaar Update "README.rst" file and documentations files.
authored
114 - **foundations.walkers.filesWalker**:
4d64a88 @KelSolaar Update documentation files.
authored
115
116 .. code:: python
117
72b2d62 @KelSolaar Refactor "foundations.walkers.FilesWalker" class into a generator.
authored
118 >>> for file in filesWalker("./foundations/tests/testsFoundations/resources/standard/level_0"):
119 ... print(file)
120 ...
121 ./foundations/tests/testsFoundations/resources/standard/level_0/level_1/level_2/standard.sIBLT
122 ./foundations/tests/testsFoundations/resources/standard/level_0/level_1/loremIpsum.txt
123 ./foundations/tests/testsFoundations/resources/standard/level_0/level_1/standard.rc
124 ./foundations/tests/testsFoundations/resources/standard/level_0/standard.ibl
125 >>> for file in filesWalker("./foundations/tests/testsFoundations/resources/standard/level_0", ("\.sIBLT",)):
126 ... print(file)
127 ...
128 ./foundations/tests/testsFoundations/resources/standard/level_0/level_1/level_2/standard.sIBLT
b9c09f0 @KelSolaar Update "README" and "CHANGELOG" files.
authored
129
130 About
131 -----
132
7b3e6cb @KelSolaar Change copyrights dates.
authored
133 | **Foundations** by Thomas Mansencal – 2008 - 2014
134 | Copyright © 2008 - 2014 – Thomas Mansencal – `thomas.mansencal@gmail.com <mailto:thomas.mansencal@gmail.com>`_
b9c09f0 @KelSolaar Update "README" and "CHANGELOG" files.
authored
135 | This software is released under terms of GNU GPL V3 license: http://www.gnu.org/licenses/
cb20502 @KelSolaar Update "README.rst" file.
authored
136 | `http://www.thomasmansencal.com/ <http://www.thomasmansencal.com/>`_
Something went wrong with that request. Please try again.