HTD

Merge lp:~ahayzen/htd/htd32_docs_update into lp:htd

Proposed by Andrew Hayzen
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 42
Merged at revision: 42
Proposed branch: lp:~ahayzen/htd/htd32_docs_update
Merge into: lp:htd
Diff against target: 191 lines (+93/-15)
4 files modified
docs/apichanges.rst (+39/-1)
docs/cursorobject.rst (+23/-1)
docs/htdobject.rst (+26/-11)
setup.py (+5/-2)
To merge this branch: bzr merge lp:~ahayzen/htd/htd32_docs_update
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Review via email: mp+171425@code.launchpad.net

Description of the change

* Update of docs

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/apichanges.rst'
2--- docs/apichanges.rst 2013-03-01 03:31:03 +0000
3+++ docs/apichanges.rst 2013-06-25 22:11:32 +0000
4@@ -4,8 +4,46 @@
5
6 .. sectionauthor:: Andrew Hayzen
7
8+
9+----------
10+Attributes
11+----------
12+
13+ * Addition of rename method so attributes can easily be renamed
14+
15+
16+------------
17+File Formats
18+------------
19+
20+ * Addition of FIXED_WIDTH_FOLDER file type
21+
22 ----------
23 Connection
24 ----------
25
26- * Addition of relation property that lists the relationships in a connection
27\ No newline at end of file
28+ * Addition of relation property that lists the relationships in a connection
29+ * Addition of support for __contains__, for example check if a table exists in a database
30+
31+ ::
32+
33+ >>> "customer" in connection
34+ True
35+
36+------
37+Cursor
38+------
39+
40+ * Addition of copy method so a table can be copied
41+ * Addition of convert method to convert tables between different file formats
42+ * Addition of lock_to_thread and unlock_from_thread methods
43+ * Update method now has start and stop parameters
44+
45+
46+------
47+Record
48+------
49+
50+ * Addition of concurrency control to records
51+ * Addition of version property for concurrency control
52+ * Addition of clear_version method for concurrency control
53\ No newline at end of file
54
55=== modified file 'docs/cursorobject.rst'
56--- docs/cursorobject.rst 2013-04-10 20:36:13 +0000
57+++ docs/cursorobject.rst 2013-06-25 22:11:32 +0000
58@@ -121,7 +121,7 @@
59
60 .. method:: __getitem__(key)
61
62- Retrieve the data of a specific record in the table, where key is the identifier of the record. This will return a dictionary array with the data for the record sorted in their repective attributes. Furthermore this method supports slicing.
63+ Retrieve the data of a specific record in the table, where key is the identifier of the record. This will return a dictionary array with the data for the record sorted in their respective attributes. Furthermore this method supports slicing.
64
65 An example of how to use this method is shown below, assuming the 'standard table' has been created using the example code at the top of this page and has been run directly before.
66
67@@ -418,6 +418,18 @@
68 >>> cursor.location
69 '/tmp/table.htd'
70
71+ .. method:: lock_to_thread([thread=None])
72+
73+ Lock the table to the thread, so that no other threads/processes can make changes. This is useful for performing tasks that need to be done in a specific order or for performance benefits.
74+
75+ An example of locking the table to a the current thread is shown below.
76+
77+ ::
78+
79+ >>> cursor.lock_to_thread()
80+
81+ .. warning:: The unlock_from_thread method must be called after the transactions have been completed.
82+
83 .. method:: rename(location [, replace=False])
84
85 Rename the table to the new `location` given, with the option to replace any existing files.
86@@ -455,6 +467,16 @@
87
88 .. note:: This function will return a generator of the values for a specific attribute of all the records in the table within the limits.
89
90+ .. method:: unlock_from_thread([thread=None])
91+
92+ Unlock the table from a thread.
93+
94+ An example of unlocking the table from the current thread is shown below.
95+
96+ ::
97+
98+ >>> cursor.unlock_from_thread()
99+
100 .. method:: update([start=0, [stop=False, [where=None, [args={}]]]])
101
102 The update method allows you to easily update multiple records with new data, the *where* parameter works in the same way as in the delete and select methods. The *start* and *end* is the index range to retrieve.
103
104=== modified file 'docs/htdobject.rst'
105--- docs/htdobject.rst 2013-04-20 15:08:15 +0000
106+++ docs/htdobject.rst 2013-06-25 22:11:32 +0000
107@@ -444,12 +444,27 @@
108
109 The data stored in the table is all of the same width (with one extra byte at the end of each section of data to signify the end of the data and to detect a NULL value). Therefore the performance of this format is much faster because the position of each record can be calulated quickly. However because the data is stored in fixed width format it can take up far more space than the VARIABLE_WIDTH_FILE.
110
111- To use the FIXED_WIDTH file type, see the example below.
112+ To use the FIXED_WIDTH_FILE file type, see the example below.
113+
114+ ::
115+
116+ >>> htd.FileTypes.FIXED_WIDTH_FILE
117+ <class 'htd._workers.file_fix.FIXED_WIDTH_FILE'>
118+
119+ .. attribute:: FIXED_WIDTH_FOLDER
120
121- ::
122-
123- >>> htd.FileTypes.FIXED_WIDTH_FILE
124- <class 'htd._workers.file_fix.FIXED_WIDTH_FILE'>
125+ This file type is used for large and high performance tables.
126+
127+ The data is stored in a fixed width format, with no data being deleted - just overwritten.
128+
129+ .. note:: This is a prototype data format which will be expanded upon in future releases
130+
131+ To use the FIXED_WIDTH_FOLDER file type, see the example below.
132+
133+ ::
134+
135+ >>> htd.FileTypes.FIXED_WIDTH_FOLDER
136+ <class 'htd._workers.file_fix.FIXED_WIDTH_FOLDER'>
137
138 .. attribute:: VARIABLE_WIDTH_FILE
139
140@@ -459,12 +474,12 @@
141
142 .. note:: This is the default file type that will be used in HTD, this can be changed in the :class:`Register`.
143
144- To use the VARIABLE_WIDTH file type, see the example below.
145-
146- ::
147+ To use the VARIABLE_WIDTH file type, see the example below.
148
149- >>> htd.FileTypes.VARIABLE_WIDTH_FILE
150- <class 'htd._workers.file_fix.VARIABLE_WIDTH_FILE'>
151+ ::
152+
153+ >>> htd.FileTypes.VARIABLE_WIDTH_FILE
154+ <class 'htd._workers.file_fix.VARIABLE_WIDTH_FILE'>
155
156 .. note:: htd.FileTypes is the initialised class and therefore doesn't need to be initialised.
157
158@@ -565,7 +580,7 @@
159
160 .. note:: The directory must already exist and the file must not already exist.
161
162- The second parameter is *identifer*, this is the identifer(s) which will be used in the table. If a single identifer is sent then this will be set as the primary key, if a list is sent then they will be set as the composite key.
163+ The second parameter is *identifier*, this is the identifier(s) which will be used in the table. If a single identifier is sent then this will be set as the primary key, if a list is sent then they will be set as the composite key.
164
165 The identifiers must be a list of the names of the attributes, these must then exist in the *attributes* parameter.
166
167
168=== modified file 'setup.py'
169--- setup.py 2013-05-12 19:04:42 +0000
170+++ setup.py 2013-06-25 22:11:32 +0000
171@@ -42,15 +42,18 @@
172 "Operating System :: Microsoft :: Windows"],
173 packages=['htd32', 'htd32/_base', 'htd32/_objects', 'htd32/_workers',
174 'htd32/_workers/file_fix', 'htd32/_workers/file_var',
175+ 'htd32/_workers/folder_fix',
176 'htd32/_workers/header', 'htd32/_workers/index',
177- 'htd32/_workers/search'],
178+ 'htd32/_workers/search', 'htd32/_workers/tree'],
179 package_dir={'htd32': 'htd32',
180 'htd32/_base': 'htd32/_base',
181 'htd32/_objects': 'htd32/_objects',
182 'htd32/_workers': 'htd32/_workers',
183 'htd32/_workers/file_fix': 'htd32/_workers/file_fix',
184 'htd32/_workers/file_var': 'htd32/_workers/file_var',
185+ 'htd32/_workers/folder_fix': 'htd32/_workers/folder_fix',
186 'htd32/_workers/header': 'htd32/_workers/header',
187 'htd32/_workers/index': 'htd32/_workers/index',
188- 'htd32/_workers/search': 'htd32/_workers/search'}
189+ 'htd32/_workers/search': 'htd32/_workers/search',
190+ 'htd32/_workers/tree': 'htd32/_workers/tree'}
191 )

Subscribers

People subscribed via source and target branches

to all changes: