ca12ee21469aba15ac1871cde07ca3d92d4fd97a
[gonvert] / src / gonvert_glade.py
1 #!/usr/bin/env python
2 # -*- coding: UTF8 -*-
3
4 import os
5 import pickle
6 import math
7 import string
8 import sys
9 import gettext
10 from math import *
11
12 import gobject
13 import gtk
14 import gtk.glade
15 import gtk.gdk
16
17 import constants
18
19 #--------- variable definitions ---------------- 
20 nums = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' # used for Computer numbers base definitions.
21 global calcsuppress #semaphore used to suppress cyclic calculations when a unit is clicked.
22 global selected_category
23 global window_size #window size used for saving and restoring application window size
24
25 calcsuppress=0
26 unit_sort_direction  = False
27 value_sort_direction = False
28 units_sort_direction = False
29 find_result=[] #empty find result list
30 find_count=0 #default to find result number zero
31 selected_category='' #preset to no selected category
32 selected_units={} #empty dictionary for later use
33 window_size=(0,0) #empty tuple for filling later
34
35 gettext.bindtextdomain('gonvert', '/usr/share/locale')
36 gettext.textdomain('gonvert')
37 _ = gettext.gettext
38
39 def shortlist_changed(a):
40         print "shortlist"
41         if shortlistcheck.get_active():
42                 print "1"
43         else:
44                 print "0"
45
46 def edit_shortlist(a):
47         print "edit shortlist"
48         if edit_shortlist1.get_active():
49                 print "1"
50         else:
51                 print "0"
52
53 def app_size_changed(a,b):
54         ''"get current size of window as it changes.''"
55         global window_size
56         window_size=app1.get_size()
57
58 def clear_selections(a):
59         global selected_units
60         os.remove(home+'/.gonvert/selections.dat')
61         selected_units={}
62
63 def exitprogram(a):
64         """
65         This routine saves the selections to a file, and 
66          should therefore only be called when exiting the program.
67         
68          Update selections dictionary which consists of the following keys:
69          'selected_category': full name of selected category
70             'selected_units': selected_units dictionary which contains:
71                                 [categoryname: #1 displayed unit, #2 displayed unit]
72         """
73         global selected_units
74
75         #Determine the contents of the selected category row
76         selected,iter= cat_clist.get_selection().get_selected()
77         selected_category = cat_model.get_value(iter,0)
78
79         selections = {'selected_category':selected_category, 'selected_units':selected_units}
80         pickle.dump(selections,open(home+'/.gonvert/selections.dat','w'))
81
82         #Get last size of app and save it
83         window_settings = {'size':window_size}
84         pickle.dump(window_settings,open(home+'/.gonvert/window.dat','w'))
85
86         gtk.mainquit
87         sys.exit()
88
89 def find_entry_changed(a):
90         #Clear out find results since the user wants to look for something new
91         global find_result
92         find_result=[] #empty find result list
93         find_count=0 #default to find result number zero
94         find_label.set_text('') #clear result
95
96 def find_key_press(a,b):
97         #Check if the key pressed was an ASCII key
98         if len(b.string)>0:
99                 #Check if the key pressed was the 'Enter' key
100                 if ord(b.string[0])==13:
101                         #Execute the find units function
102                         find_units(1)
103
104 def about_clicked(a):
105         about_box.show()
106 def about_hide(*args):
107         about_box.hide()
108         return gtk.TRUE
109
110 def messagebox_ok_clicked(a):
111         messagebox.hide()
112
113 def find_units(a):
114         global find_count
115         global selected_category
116         global column1,col
117
118         #check if 'new find' or 'last find' or 'next-find'
119
120         #new-find = run the find algorithm which also selects the first found unit
121         #         = find_count=0 and find_result=[]
122
123         #last-find = restart from top again
124         #          = find_count=len(find_result)
125
126         #next-find = continue to next found location
127         #           = find_count=0 and len(find_result)>0
128
129         #check for new-find
130         if len(find_result)==0:
131           find_string = string.lower(string.strip(find_entry.get_text()))
132           #Make sure that a valid find string has been requested
133           if len(find_string)>0:
134             categories=list_dic.keys()
135             categories.sort()
136             found_a_unit=0 #reset the 'found-a-unit' flag
137             cat_no=0
138             for category in categories:
139               units=list_dic[category].keys()
140               units.sort()
141               del units[0] # do not display .base_unit description key
142               unit_no=0
143               for unit in units:
144                 if string.find(string.lower(unit), find_string)>=0:
145                   found_a_unit=1 #indicate that a unit was found
146                   #print "'",find_string,"'"," found at category=", category," unit =",unit
147                   find_result.append((category,unit,cat_no,unit_no))
148                 unit_no=unit_no+1
149               cat_no=cat_no+1
150
151             if found_a_unit==1:
152               #select the first found unit
153               find_count=0
154               #check if next find is in a new category (prevent category changes when unnecessary
155               if selected_category!=find_result[find_count][0]:
156                 cat_clist.set_cursor(find_result[0][2],col,False)
157               clist1.set_cursor(find_result[0][3],column1,True)
158               if len(find_result)>1:
159                 find_label.set_text(('  Press Find for next unit. '+ str(len(find_result))+' result(s).'))
160             else:
161               find_label.set_text('  Text not found') #Display error
162         else: #must be next-find or last-find
163           #check for last-find
164           if find_count==len(find_result)-1:
165             #select first result
166             find_count=0
167             cat_clist.set_cursor(find_result[find_count][2],col,False)
168             clist1.set_cursor(find_result[find_count][3],column1,True)
169           else: #must be next-find
170             find_count=find_count+1
171             #check if next find is in a new category (prevent category changes when unnecessary
172             if selected_category!=find_result[find_count][0]:
173               cat_clist.set_cursor(find_result[find_count][2],col,False)
174             clist1.set_cursor(find_result[find_count][3],column1,True)
175
176 def click_column(col):
177         ''"Sort the contents of the column when the user clicks on the title.''"
178         global unit_sort_direction
179         global value_sort_direction
180         global units_sort_direction
181         global column1, column2, unit_model
182
183         #Determine which column requires sorting
184         if col.get_title()==_(u"Unit Name"):
185           selected_column=0
186           column1.set_sort_indicator(True)
187           column2.set_sort_indicator(False)
188           column3.set_sort_indicator(False)
189           column1.set_sort_order(not unit_sort_direction)
190         elif col.get_title()==_(u"Value"):
191           selected_column=1
192           column1.set_sort_indicator(False)
193           column2.set_sort_indicator(True)
194           column3.set_sort_indicator(False)
195           column2.set_sort_order(not value_sort_direction)
196         else:
197           selected_column=2
198           column1.set_sort_indicator(False)
199           column2.set_sort_indicator(False)
200           column3.set_sort_indicator(True)
201           column3.set_sort_order(not units_sort_direction)
202
203         #declare a spot to hold the sorted list
204         sorted_list = []
205
206         #point to the first row
207         iter=unit_model.get_iter_first()
208         row=0
209
210         while (iter):
211           #grab all text from columns for sorting
212
213           #get the text from each column
214           unit_text = unit_model.get_value(iter,0)
215           units_text = unit_model.get_value(iter,2)
216
217           #do not bother sorting if the value column is empty
218           if unit_model.get_value(iter,1)=='' and selected_column==1:
219             return
220           
221           #special sorting exceptions for ascii values (instead of float values)
222           if selected_category == "Computer Numbers":   
223             value_text = unit_model.get_value(iter,1)
224           else:
225             if unit_model.get_value(iter,1)==None or unit_model.get_value(iter,1)=='':
226               value_text = ''
227             else:
228               value_text = float(unit_model.get_value(iter,1))
229
230           if selected_column==0:
231             sorted_list.append((unit_text,value_text,units_text))
232           elif selected_column==1:
233             sorted_list.append((value_text,unit_text,units_text))
234           else:
235             sorted_list.append((units_text,value_text,unit_text))
236
237           #point to the next row in the unit_model
238           iter=unit_model.iter_next(iter)
239           row=row+1
240
241         #check if no calculations have been made yet (don't bother sorting)
242         if row==0:
243           return
244         else:
245           if selected_column==0:
246             if not unit_sort_direction:
247               sorted_list.sort(lambda (x,xx,xxx), (y,yy,yyy): cmp(string.lower(x),string.lower(y)))
248               unit_sort_direction=True
249             else:
250               sorted_list.sort(lambda (x,xx,xxx), (y,yy,yyy): cmp(string.lower(y),string.lower(x)))
251               unit_sort_direction=False
252           elif selected_column==1:
253             sorted_list.sort()
254             if not value_sort_direction:
255               value_sort_direction=True
256             else:
257               sorted_list.reverse()
258               value_sort_direction=False
259           else:
260             if not units_sort_direction:
261               sorted_list.sort(lambda (x,xx,xxx), (y,yy,yyy): cmp(string.lower(x),string.lower(y)))
262               units_sort_direction=True
263             else:
264               sorted_list.sort(lambda (x,xx,xxx), (y,yy,yyy): cmp(string.lower(y),string.lower(x)))
265               units_sort_direction=False
266
267           #Clear out the previous list of units
268           unit_model = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING,gobject.TYPE_STRING)
269           clist1.set_model(unit_model)
270
271           #colourize each row differently for easier reading
272           clist1.set_property( 'rules_hint',1)
273
274           #Clear out the description
275           text_model = gtk.TextBuffer(None)
276           text1.set_buffer(text_model)
277
278           if selected_column==0:
279             for unit,value,units in sorted_list:
280               iter = unit_model.append()
281               unit_model.set(iter,0,unit,1,str(value),2,units)
282           elif selected_column==1:
283             for value,unit,units in sorted_list:
284               iter = unit_model.append()
285               unit_model.set(iter,0,unit,1,str(value),2,units)
286           else:
287             for units,value,unit in sorted_list:
288               iter = unit_model.append()
289               unit_model.set(iter,0,unit,1,str(value),2,units)
290         return
291
292 def click_category(row):
293         global unit_sort_direction
294         global value_sort_direction
295         global units_sort_direction
296         global unit_model, cat_model
297         global selected_category, selected_units
298         global unit_dic, list_dic
299
300         #Clear out the previous list of units
301         unit_model = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING,gobject.TYPE_STRING)
302         clist1.set_model(unit_model)
303
304         #Colourize each row alternately for easier reading
305         clist1.set_property( 'rules_hint',1)
306
307         #Clear out the description
308         text_model = gtk.TextBuffer(None)
309         text1.set_buffer(text_model)
310
311         #Determine the contents of the selected category row
312         selected,iter= row.get_selection().get_selected()
313
314         selected_category = cat_model.get_value(iter,0)
315
316         unit_sort_direction  = False
317         value_sort_direction = False
318         units_sort_direction = False
319         column1.set_sort_indicator(False)
320         column2.set_sort_indicator(False)
321         column3.set_sort_indicator(False)
322
323         unit_dic=list_dic[selected.get_value(iter,0)]
324         keys = unit_dic.keys()
325         keys.sort()
326         del keys[0] # do not display .base_unit description key
327
328         #Fill up the units descriptions and clear the value cells
329         for key in keys:
330           iter = unit_model.append()
331           unit_model.set(iter,0,key,1,'',2,unit_dic[key][1])
332
333         entry1.set_text('')
334         entry2.set_text('')
335         entry3.set_text('')
336         entry4.set_text('')
337         label1.set_text('')
338         label2.set_text('')
339
340         restore_units()
341
342 def restore_units():
343         global selected_category, selected_units
344         global unit_dic, list_dic
345
346         # Restore the previous historical settings of previously selected units in this newly selected category
347         #Since category has just been clicked, the list will be sorted already.
348         if selected_units.has_key(selected_category):
349           if selected_units[selected_category][0]:
350                 ''"debug ''"
351                 #selected_units[selected_category]=[selected_unit,selected_units[selected_category][0]]
352
353                 units=list_dic[selected_category].keys()
354                 units.sort()
355                 del units[0] # do not display .base_unit description key
356
357                 #Restore oldest selection first.
358                 if selected_units[selected_category][1]:
359                         unit_no=0
360                         for unit in units:
361                                 if unit==selected_units[selected_category][1]:
362                                         clist1.set_cursor(unit_no,column1,True)
363                                 unit_no=unit_no+1
364
365                 #Restore newest selection second.
366                 unit_no=0
367                 for unit in units:
368                         if unit==selected_units[selected_category][0]:
369                                 clist1.set_cursor(unit_no,column1,True)
370                         unit_no=unit_no+1
371
372         # select the text so user can start typing right away
373         entry2.grab_focus()
374         entry2.select_region(0,-1)
375
376 def button_released(row,a):
377         click_unit(row)
378
379 def click_unit(row):
380         global selected_category
381         global calcsuppress
382         global selected_units
383
384         calcsuppress = 1 #suppress calculations
385
386         #Determine the contents of the selected row.
387         selected,iter= clist1.get_selection().get_selected()
388
389         selected_unit=selected.get_value(iter,0)
390
391         unit_spec=unit_dic[selected_unit]
392
393         #Clear out the description
394         text_model = gtk.TextBuffer(None)
395         text1.set_buffer(text_model)
396
397         enditer = text_model.get_end_iter()
398         text_model.insert(enditer,unit_spec[2])
399
400         if entry1.get_text() <> selected_unit:
401                 entry3.set_text(entry1.get_text())
402                 entry4.set_text(entry2.get_text())
403                 if label1.get() == None:
404                         label2.set_text('')
405                 else:
406                         label2.set_text(label1.get())
407         entry1.set_text(selected_unit)
408
409         entry2.set_text(selected.get_value(iter,1))
410
411         label1.set_text(unit_spec[1]) # put units into label text
412         if entry2.get_text() =='':
413                 if selected_category == "Computer Numbers":
414                         entry2.set_text("0")
415                 else:
416                         entry2.set_text("0.0")
417
418         #For historical purposes, record this unit as the most recent one in this category.
419         # Also, if a previous unit exists, then shift that previous unit to oldest unit.
420         if selected_units.has_key(selected_category):
421           if selected_units[selected_category][0]:
422             selected_units[selected_category]=[selected_unit,selected_units[selected_category][0]]
423         else:
424           selected_units[selected_category]=[selected_unit,'']
425
426         # select the text so user can start typing right away
427         entry2.grab_focus()
428         entry2.select_region(0,-1)
429
430         calcsuppress = 0 #enable calculations
431
432 def write_units(a):
433         ''"Write the list of categories and units to stdout for documentation purposes.''"
434         messagebox_model = gtk.TextBuffer(None)
435         messageboxtext.set_buffer(messagebox_model)
436         messagebox_model.insert_at_cursor(_(u'The units are being written to stdout. You can capture this printout by starting gonvert from the command line as follows:\n$ gonvert > file.txt'),-1)
437         messagebox.show()
438         while gtk.events_pending():
439           gtk.mainiteration (False)
440         category_keys=list_dic.keys()
441         category_keys.sort()
442         total_categories = 0
443         total_units = 0
444         print 'gonvert-%s%s' % (
445                 constants.__version__,
446                 _(u' - Unit Conversion Utility  - Convertible units listing:')
447         )
448         for category_key in category_keys:
449                 total_categories = total_categories + 1
450                 print category_key,":"
451                 unit_dic=list_dic[category_key]
452                 unit_keys = unit_dic.keys()
453                 unit_keys.sort()
454                 del unit_keys[0] # do not display .base_unit description key
455                 for unit_key in unit_keys:
456                         total_units = total_units + 1
457                         print "\t",unit_key
458         print total_categories,' categories'
459         print total_units,' units'
460         messagebox_model = gtk.TextBuffer(None)
461         messageboxtext.set_buffer(messagebox_model)
462         messagebox_model.insert_at_cursor(_(u'The units list has been written to stdout. You can capture this printout by starting gonvert from the command line as follows:\n$ gonvert > file.txt'),-1)
463
464 def makeBase(x, base = len(nums), table=nums):
465         ''"Convert from base 10 to any other base. ''"
466         d, m = divmod(x, base)
467         if d:
468                 return makeBase(d,base, table) + table[int(m)]
469         else:
470                 return table[int(m)]
471
472 # roman numerals
473 roman_group = { 1: ('i','v'),
474                10: ('x','l'),
475               100: ('c','d'),
476              1000: ('m','A'),
477             10000: ('B','C'),
478         }
479
480 # functions that convert Arabic digits to roman numerals
481 roman_value = {
482         0: lambda i,v,x: '',
483         1: lambda i,v,x: i,
484         2: lambda i,v,x: i+i,
485         3: lambda i,v,x: i+i+i,
486         4: lambda i,v,x: i+v,
487         5: lambda i,v,x: v,
488         6: lambda i,v,x: v+i,
489         7: lambda i,v,x: v+i+i,
490         8: lambda i,v,x: v+i+i+i,
491         9: lambda i,v,x: i+x,
492         }
493
494 def toroman( n ):
495         ''' convert a decimal number in [1,4000) to a roman numeral '''
496         if n < 1:
497             return ''
498         if n >= 4000:
499             return "Too large"
500         base = 1
501         s = ''
502         while n > 0:
503             i,v = roman_group[base]
504             base = base * 10
505             x,l = roman_group[base]
506             digit = n % 10
507             n = (n-digit)/10
508             s = roman_value[digit](i,v,x) + s
509         return s
510
511 def fromroman( s, rbase=1 ):
512         ''' convert a roman numeral (in lowercase) to a decimal integer '''
513         if len(s) == 0:
514             return 0
515         if rbase > 1000:
516             return 0
517         i,v = roman_group[rbase]
518         x,l = roman_group[rbase*10]
519         if   s[-4:] == v+i+i+i: digit,s = 8,s[:-4]
520         elif s[-4:] == i+i+i+i: digit,s = 4,s[:-4]
521         elif s[-3:] == v+i+i  : digit,s = 7,s[:-3]
522         elif s[-3:] == i+i+i  : digit,s = 3,s[:-3]
523         elif s[-2:] == v+i    : digit,s = 6,s[:-2]
524         elif s[-2:] == i+x    : digit,s = 9,s[:-2]
525         elif s[-2:] == i+v    : digit,s = 4,s[:-2]
526         elif s[-2:] == i+i    : digit,s = 2,s[:-2]
527         elif s[-1:] == i      : digit,s = 1,s[:-1]
528         elif s[-1:] == v      : digit,s = 5,s[:-1]
529         else                  : digit,s = 0,s
530         return digit*rbase + fromroman(s,rbase*10)
531
532 class Ccalculate:
533         def top(self,a):
534           global calcsuppress
535           global unit_model
536           global testvalue
537
538           if calcsuppress == 1:
539             #calcsuppress = 0
540             return
541           # determine if value to be calculated is empty
542           if selected_category == "Computer Numbers":
543             if entry2.get_text() =='':
544               value = '0'
545             else:
546                value = entry2.get_text()
547           else:
548             if entry2.get_text() =='':
549               value = 0.0
550             else:
551               value = float(entry2.get_text())
552
553           if entry1.get_text() <> '':
554             func,arg = unit_dic[entry1.get_text()][0] #retrieve the conversion function and value from the selected unit
555             base = apply(func.to_base,(value,arg,)) #determine the base unit value
556
557             keys = unit_dic.keys()
558             keys.sort()
559             del keys[0]
560             row = 0
561
562             #point to the first row
563             iter=unit_model.get_iter_first()
564
565             while (iter):
566               #get the formula from the name at the row
567               func,arg = unit_dic[unit_model.get_value(iter,0)][0]
568
569               #set the result in the value column
570               unit_model.set(iter,1,str(apply(func.from_base,(base,arg,))))
571
572               #point to the next row in the unit_model
573               iter=unit_model.iter_next(iter)
574
575             # if the second row has a unit then update its value
576             if entry3.get_text() <> '':
577               calcsuppress=1
578               func,arg = unit_dic[entry3.get_text()][0]
579               entry4.set_text(str(apply(func.from_base,(base,arg,))))
580               calcsuppress=0
581
582         def bottom(self,a):
583           global calcsuppress
584           if calcsuppress == 1:
585             #calcsuppress = 0
586             return
587           # determine if value to be calculated is empty
588           if selected_category == "Computer Numbers":
589             if entry4.get_text() =='':
590               value = '0'
591             else:
592               value = entry4.get_text()
593           else:
594             if entry4.get_text() =='':
595               value = 0.0
596             else:
597               value = float(entry4.get_text())
598
599           if entry3.get_text() <> '':
600             func,arg = unit_dic[entry3.get_text()][0] #retrieve the conversion function and value from the selected unit
601             base = apply(func.to_base,(value,arg,)) #determine the base unit value
602
603             keys = unit_dic.keys()
604             keys.sort()
605             del keys[0]
606             row = 0
607
608             #point to the first row
609             iter=unit_model.get_iter_first()
610
611             while (iter):
612               #get the formula from the name at the row
613               func,arg = unit_dic[unit_model.get_value(iter,0)][0]
614
615               #set the result in the value column
616               unit_model.set(iter,1,str(apply(func.from_base,(base,arg,))))
617
618               #point to the next row in the unit_model
619               iter=unit_model.iter_next(iter)
620
621             # if the second row has a unit then update its value
622             if entry1.get_text() <> '':
623               calcsuppress=1
624               func,arg = unit_dic[entry1.get_text()][0]
625               entry2.set_text(str(apply(func.from_base,(base,arg,))))
626               calcsuppress=0
627
628
629 #All classes for conversions are defined below:
630 # each class should have one method for converting "to_base and another for converting "from_base"
631 #the return value is the converted value to or from base
632 class simple_multiplier:
633         def to_base(self,value,multiplier):
634                 return value * (multiplier)
635         def from_base(self,value,multiplier):
636                 if multiplier == 0:
637                         return 0.0
638                 else:
639                         return value / (multiplier)
640
641 class simple_inverter:
642         def to_base(self,value,multiplier):
643                 if value == 0:
644                         return 0.0
645                 else:
646                         return (multiplier) / value
647         def from_base(self,value,multiplier):
648                 if value == 0:
649                         return 0.0
650                 else:
651                         return (multiplier) / value
652 class simple_gain_offset:
653         def to_base(self,value,(gain,offset)):
654                 return (value * (gain)) + offset
655         def from_base(self,value,(gain,offset)):
656                 if gain == 0:
657                         return 0.0
658                 else:
659                         return (value - offset) / gain
660
661 class simple_offset_gain:
662         def to_base(self,value,(offset,gain)):
663                 return (value + offset) * gain
664         def from_base(self,value,(offset,gain)):
665                 if gain == 0:
666                         return 0.0
667                 else:
668                         return (value / gain) - offset
669
670 class slope_offset:
671         ''"convert using points on a graph''"
672         def to_base(self,value,((low_in,high_in),(low_out,high_out))):
673                 gain = (high_out-low_out)/(high_in-low_in)
674                 offset = low_out - gain*low_in
675                 return gain*value+offset
676         def from_base(self,value,((low_out,high_out),(low_in,high_in))):
677                 gain = (high_out-low_out)/(high_in-low_in)
678                 offset = low_out - gain*low_in
679                 return gain*value+offset
680
681 class double_slope_offset:
682         ''"convert using points on a graph, graph split into two slopes''"
683         def to_base(self,value,((low1_in,high1_in),(low1_out,high1_out),(low2_in,high2_in),(low2_out,high2_out))):
684                 if low1_in<=value<=high1_in:
685                         gain = (high1_out-low1_out)/(high1_in-low1_in)
686                         offset = low1_out - gain*low1_in
687                         return gain*value+offset
688                 if low2_in<=value<=high2_in:
689                         gain = (high2_out-low2_out)/(high2_in-low2_in)
690                         offset = low2_out - gain*low2_in
691                         return gain*value+offset
692                 return 0.0
693         def from_base(self,value,((low1_in,high1_in),(low1_out,high1_out),(low2_in,high2_in),(low2_out,high2_out))):
694                 if low1_out<=value<=high1_out:
695                         gain = (high1_in-low1_in)/(high1_out-low1_out)
696                         offset = low1_in - gain*low1_out
697                         return gain*value+offset
698                 if low2_out<=value<=high2_out:
699                         gain = (high2_in-low2_in)/(high2_out-low2_out)
700                         offset = low2_in - gain*low2_out
701                         return gain*value+offset
702                 return 0.0
703
704 class base_converter:
705         #Convert from any base to base 10 (decimal)
706         def to_base(self,value,base):
707                 result   = 0L #will contain the long base-10 (decimal) number to be returned
708                 position = len(value)   #length of the string that is to be converted
709                 for x in value:
710                         position = position-1
711                         result = long(result + long(long(string.find(nums,x))*(long(base)**long(position))))
712                 return result
713         #Convert from decimal to any base
714         def from_base(self,value,base):
715                 return makeBase(value,base)
716
717 class roman_numeral:
718         #Convert from roman numeral to base 10 (decimal)
719         def to_base(self,value,junk):
720                 if value=="0":
721                         return 0L
722                 else:
723                         return fromroman(value)
724         #Convert from decimal to roman numeral
725         def from_base(self,value,junk):
726                 return toroman(value)
727
728 class function:
729         ''"defined simple function can be as complicated as you like, however, both to/from base must be defined.''"
730         #value is assumed to be a string
731         #convert from a defined function to base
732         def to_base(self,value,(to_base,from_base)):
733                 exec "y="+to_base[:string.find(to_base,'x')]+str(value)+to_base[string.find(to_base,'x')+1:]
734                 return y
735         def from_base(self,value,(to_base,from_base)):
736                 exec "y="+from_base[:string.find(from_base,'x')]+str(value)+from_base[string.find(from_base,'x')+1:]
737                 return y
738
739
740 #----------- Program starts below ----------------
741 #Prepare to read in previous category, units placemenmts, window size
742 home = os.environ['HOME']
743 #check for users gonvert directories
744 if not os.path.exists(home+'/.gonvert'):
745         print "Creating ~/.gonvert directory to hold settings."
746         os.mkdir(home+'/.gonvert')
747
748
749 #check to see if glade file is in current directory (user must be running from download untar directory)
750 if os.path.exists('gonvert.glade'):
751         homepath=''
752         pixmapspath='pixmaps/'
753 elif os.path.exists('/usr/local/share/gonvert/gonvert.glade'):
754         homepath='/usr/local/share/gonvert/'
755         pixmapspath='/usr/local/share/pixmaps/'
756 else:
757         #look for it in the installed directory
758         homepath=sys.path[0] + '/../share/gonvert/'
759         if  os.path.exists('/usr/share/pixmaps/gonvert.png'): #Check fedora pixmaps directory
760                 pixmapspath='/usr/share/pixmaps/'
761         else:
762                 pixmapspath=homepath  +'/../pixmaps/'
763
764 #print pixmapspath #debug
765 gladefile=homepath+'gonvert.glade'
766
767 widgets = gtk.glade.XML(gladefile)
768 app1 = widgets.get_widget('app1')
769
770 #Restore window size from previously saved settings if it exists and is valid.
771 if os.path.exists(home+'/.gonvert/window.dat'):
772   #Retrieving previous window settings from ~/.gonvert/window.dat
773   saved_window=pickle.load(open(home+'/.gonvert/window.dat','r'))
774   #If the 'size' has been stored, then extract size from saved_window.
775   if saved_window.has_key('size'):
776     a,b=saved_window['size']
777     app1.resize(a,b)
778   else:
779     #Maximize if no previous size was found
780     app1.maximize()
781 else:
782   #Maximize if no previous window.dat file was found
783   app1.maximize()
784
785 app1.set_title('gonvert- %s - Unit Conversion Utility' % constants.__version__);
786 if  os.path.exists(pixmapspath  + 'gonvert.png'):
787         app1.set_icon(gtk.gdk.pixbuf_new_from_file(pixmapspath  + 'gonvert.png'))
788 else:
789         print "Error: Could find gonvert icon, it should be here: "
790         print pixmapspath
791
792 #--------- function definitions from classes ------------
793 m=simple_multiplier()
794 inv=simple_inverter()
795 gof=simple_gain_offset()
796 ofg=simple_offset_gain()
797 slo=slope_offset()
798 dso=double_slope_offset()
799 b=base_converter()
800 r=roman_numeral()
801 f=function()
802 calculate=Ccalculate()
803
804
805 #--------- connections to GUI ----------------
806 dic = {"on_exit1_activate": exitprogram,
807        "on_app1_destroy": exitprogram,
808        "on_cat_clist_select_row": click_category,
809        "on_clist1_click_column": click_column,
810        "on_entry2_changed": calculate.top,
811        "on_entry4_changed": calculate.bottom,
812        "on_write_units1_activate":write_units,
813        "on_find_button_clicked":find_units,
814        "on_find_entry_key_press_event":find_key_press,
815        "on_find_entry_changed":find_entry_changed,
816        "on_about1_activate":about_clicked,
817        "on_about_close_clicked":about_hide,
818        "on_messagebox_ok_clicked":messagebox_ok_clicked,
819        "on_clear_selections1_activate":clear_selections,
820        "on_clist1_cursor_changed":click_unit,
821        "on_clist1_button_released":button_released,
822        "on_app1_size_allocate":app_size_changed,
823        "on_shortlistcheck_toggled":shortlist_changed,
824        "on_edit_shortlist1_activate":edit_shortlist,
825
826        }
827
828 widgets.signal_autoconnect (dic);
829
830 def change_menu_label(labelname,newtext):
831         item_label  = widgets.get_widget(labelname).get_children()[0]
832         item_label.set_text(newtext)
833 def change_label(labelname,newtext):
834         item_label  = widgets.get_widget(labelname)
835         item_label.set_text(newtext)
836
837 change_menu_label('file1',_('File'))
838 change_menu_label('exit1',_('Exit'))
839 change_menu_label('tools1',_('Tools'))
840 change_menu_label('clear_selections1',_('Clear selections'))
841 change_menu_label('write_units1',_('Write Units'))
842 change_menu_label('help1',_('Help'))
843 change_menu_label('about1',_('About'))
844
845 change_menu_label('find_button',_('Find'))
846
847 shortlistcheck = widgets.get_widget('shortlistcheck')
848 edit_shortlist1 = widgets.get_widget('edit_shortlist1')
849
850 cat_clist  = widgets.get_widget('cat_clist' )
851
852 clist1 = widgets.get_widget('clist1')
853 clist1_selection=clist1.get_selection()
854
855 entry1 = widgets.get_widget('entry1')
856 entry2 = widgets.get_widget('entry2')
857 entry3 = widgets.get_widget('entry3')
858 entry4 = widgets.get_widget('entry4')
859 about_box = widgets.get_widget('about_box')
860 messagebox = widgets.get_widget('msgbox')
861 messageboxtext = widgets.get_widget('msgboxtext')
862
863 about_image = widgets.get_widget('about_image')
864 about_image.set_from_file(pixmapspath  +'gonvert.png')
865 versionlabel = widgets.get_widget('versionlabel')
866 versionlabel.set_text(constants.__version__)
867
868 label1 =widgets.get_widget('label1')
869 label2 =widgets.get_widget('label2')
870
871 text1  = widgets.get_widget('text1' )
872
873 find_entry = widgets.get_widget('find_entry')
874 find_label = widgets.get_widget('find_label')
875
876
877
878
879 #----- main dictionary of unit descriptions below ------------
880 # first entry defines base unit
881 # remaining entries define unit specifications [(function,argument), units, description]
882 #       where function can be m and argument is the multiplying factor to_base
883 #       or function can be any other arbitrary function and argument can be a single argument
884 list_dic = {
885         _(u"Acceleration"):{".base_unit":_(u"meter per second squared"),
886                 _(u"free fall"):
887                         [(m,9.80665),_(u"gn"),_(u"The ideal falling motion of a body that is subject only to the earth's gravitational field.")],
888                 _(u"meter per second squared"):
889                         [(m,1.0),u"m/s\xb2",u''],
890                 _(u"foot per second squared"):
891                         [(m,30.48/100),u"ft/s\xb2",u''],
892                 _(u"centimeter per second squared"):
893                         [(m,1/100.0),u"cm/s\xb2",''],
894                 _(u"gal"):
895                         [(m,1/100.0),_(u"Gal"),_(u"A unit of gravitational acceleration equal to one centimeter per second per second (named after Galileo)")],
896                 _(u"millimeter per second squared"):
897                         [(m,1/1000.0),u"mm/s\xb2",'']
898         },
899
900         _(u"Angle"):{".base_unit":_(u"radian"),
901                 _(u"revolution / circle / perigon / turn"):
902                         [(m,2.0*pi),"r",_(u"The act of revolving, or turning round on an axis or a center; the motion of a body round a fixed point or line; rotation; as, the revolution of a wheel, of a top, of the earth on its axis, etc.")],
903                 _(u"right angle"):
904                         [(m,pi/2.0),"L",_(u"The angle formed by one line meeting another perpendicularly")],
905                 _(u"radian"):
906                         [(m,1.0),_(u"rad"),_(u"An arc of a circle which is equal in length to the radius, or the angle measured by such an arc.")],
907                 _(u"degree"):
908                         [(m,pi/180.0),u"\xb0",_(u"1/360 of a complete revolution.")],
909                 _(u"grad | grade | gon"):
910                         [(m,pi/200),_(u"g"),_(u"One-hundredth of a right angle.")],
911                 _(u"milliradian"):
912                         [(m,1/1000.0),_(u"mrad"),_(u"A unit of angular distance equal to one thousandth of a radian.")],
913                 _(u"minute"):
914                         [(m,pi/(180.0*60)),"'",_(u"The sixtieth part of a degree; sixty seconds (Marked thus ('); as, 10deg 20').")],
915                 _(u"second"):
916                         [(m,pi/(180.0*60*60)),'"',_(u"""One sixtieth of a minute.(Marked thus ("); as, 10deg 20' 30"). ''""")],
917                 _(u"mil"):
918                         [(m,(2*pi)/6400),'',_(u"Used in artillery; 1/6400 of a complete revolution.")],
919                 _(u"centesimal minute"):
920                         [(m,pi/20000),'',_(u"One hundredth of a grade, 0.01 grade")],
921                 _(u"centesimal second"):
922                         [(m,pi/2000000),'',_(u"One ten-thousandth of a grade, 0.0001 grade")],
923                 _(u"octant"):
924                         [(m,pi/4.0),'',_(u"The eighth part of a circle (an arc of 45 degrees).")],
925                 _(u"quadrant"):
926                         [(m,pi/2.0),'',_(u"The fourth part of a circle (an arc of 90 degrees).")],
927                 _(u"sextant"):
928                         [(m,pi/3.0),'',_(u"The sixth part of a circle (an arc of 60 degrees).")],
929                 _(u"point"):
930                         [(m,pi/16.0),'',_(u"1/32 of a circle. Points are used on the face of a compass (32 points). Each point is labelled clockwise starting from North as follows: North, North by East, North Northeast, Northeast by North, and Northeast, etc.")],
931                 _(u"sign"):
932                         [(m,pi/6.0),'',_(u"The twelfth part of a circle as in twelve signs of the zodiac (an arc of 30 degrees).")],
933         },
934         _(u"Angular Velocity / Frequency"):{".base_unit":_(u"radian per second"),
935                 _(u"kiloradian per second"):
936                         [(m,1000.0),"krad/s",''],
937                 _(u"revolution per second"):
938                         [(m,2*pi),"rev/s",''],
939                 _(u"hertz"):
940                         [(m,2*pi),"Hz",_(u"Named after the German physicist Heinrich Hertz (1857-1894) who was the first to produce electromagnetic waves artificially. Having a periodic interval of one second.")],
941                 _(u"radian per second"):
942                         [(m,1.0),"rad/s",''],
943                 _(u"milliradian per second"):
944                         [(m,1/1000.0),"mrad/s",''],
945                 _(u"revolution per minute"):
946                         [(m,(2*pi)/60.0),"rpm",''],
947                 _(u"revolution per hour"):
948                         [(m,(2*pi)/3600.0),"rph",''],
949                 _(u"revolution per day"):
950                         [(m,(2*pi)/(3600.0*24)),"rpd",''],
951                 _(u"gigahertz"):
952                         [(m,1e9*2*pi),"GHz",_(u"One billion hertz.")],
953                 _(u"terahertz"):
954                         [(m,1e12*2*pi),"THz",''],
955                 _(u"petahertz"):
956                         [(m,1e15*2*pi),"PHz",''],
957                 _(u"exahertz"):
958                         [(m,1e18*2*pi),"EHz",''],
959                 _(u"megahertz"):
960                         [(m,1e6*2*pi),"MHz",_(u"One million hertz.")],
961                 _(u"kilohertz"):
962                         [(m,1e3*2*pi),"kHz",_(u"One thousand hertz.")],
963         },
964         _(u"Area"):{".base_unit":_(u"square meter"),
965                 _(u"meter diameter circle"):
966                         [(f,('pi*(x/2.0)**2','2.0*(x/pi)**(0.5)')),"m dia.",_(u"Type the diameter of the circle in meters to find its area displayed in other fields.")],
967                 _(u"centimeter diameter circle"):
968                         [(f,('pi*(x/200.0)**2','200.0*(x/pi)**(0.5)')),"cm dia.",_(u"Type the diameter of the circle in centimeters to find its area displayed in other fields.")],
969                 _(u"inch diameter circle"):
970                         [(f,('pi*(((x*(25.4/1000))/2.0) )**2','1000/25.4 * 2.0*(x/pi)**(0.5)')),"in dia.",_(u"Type the diameter of the circle in inches to find its area displayed in other fields.")],
971                 _(u"foot diameter circle"):
972                         [(f,('pi*(((x*((12*25.4)/1000))/2.0) )**2','1000/(12*25.4) * 2.0*(x/pi)**(0.5)')),"ft dia.",_(u"Type the diameter of the circle in feet to find its area displayed in other fields.")],
973                 _(u"are"):
974                         [(m,100.0),'',_(u"The unit of superficial measure, being a square of which each side is ten meters in length; 100 square meters, or about 119.6 square yards.")],
975                 _(u"acre"):
976                         [(m,4046.8564224),'',_(u"A piece of land, containing 160 square rods, or 4,840 square yards, or 43,560 square feet. This is the English statute acre. That of the United States is the same. The Scotch acre was about 1.26 of the English, and the Irish 1.62 of the English. Note: The acre was limited to its present definite quantity by statutes of Edward I., Edward III., and Henry VIII.")],
977                 _(u"acre (Cheshire)"):
978                         [(m,8561.97632),'',''],
979                 _(u"acre (Irish)"):
980                         [(m,6555.26312),'',''],
981                 _(u"acre (Scottish)"):
982                         [(m,5142.20257),'',''],
983                 _(u"arpent (French)"):
984                         [(m,4088/1.196),'',_(u" 4,088 sq. yards, or nearly five sixths of an English acre.")],
985                 _(u"arpent (woodland)"):
986                         [(m,16*25.29285264*10+16*25.29285264*2.5+(16*25.29285264*10)/160),'',_(u"1 acre, 1 rood, 1 perch")],
987                 _(u"barn"):
988                         [(m,1.0/1e28),'',_('Used in Nuclear physics to describe the apparent cross-sectional size of atomic sized objects that are bombarded with smaller objects (like electrons). 10^-28 square meters. 100 square femtometers. Originated from the semi-humorous idiom big as a barn and used by physicists to describe the size of the scattering object (Ex: That was as big as 5 barns!).')],
989                 _(u"cho"):
990                         [(m,16*25.29285264*10*2.45),'',_(u"Japanese. 2.45 acre")],
991                 _(u"circular inch"):
992                         [(m,1000000.0/(1e6*1550*1.273)),'',''],
993                 _(u"circular mil"):
994                         [(m,1.0/(1e6*1550*1.273)),"cmil",''],
995                 _(u"desyatina | dessiatina"):
996                         [(m,16*25.29285264*10*2.6996),'',_(u"Russian. 2.6996 acre. 2400 square sadzhens")],
997                 _(u"flag"):
998                         [(m,25/10.7639104167097),'',_(u"square pace (a pace is 5 feet).")],
999                 _(u"hide | carucate"):
1000                         [(m,40468.71618),'',_(u"An ancient English measure of the amount of land required to support family")],
1001                 _(u"hectare"):
1002                         [(m,10000.0),"ha",_(u"A measure of area, or superficies, containing a hundred ares, or 10,000 square meters, and equivalent to 2.471 acres.")],
1003                 _(u"homestead | quarter section"):
1004                         [(m,16*25.29285264*10*160),'',_(u"160 acres,1/4 square mile, or 1/4 section. Use by the governments of North America early settlers in the western states and provinces were allowed to take title to a homestead of 160 acres of land by registering a claim, settling on the land, and cultivating it.")],
1005                 _(u"perch"):
1006                         [(m,(16*25.29285264*10)/160),'',_(u"Used to measure land. A square rod; the 160th part of an acre.")],
1007                 _(u"sabin"):
1008                         [(m,1/10.7639104167097),'',_(u"A unit of acoustic absorption equivalent to the absorption by a square foot of a surface that absorbs all incident sound. 1ft\xb2.")],
1009                 _(u"square"):
1010                         [(m,100/10.7639104167097),'',_(u"Used in the construction for measuring roofing material, finished lumber, and other building materials. One square is equals 100 square feet.")],
1011                 _(u"section"):
1012                         [(m,2.59*1E6),'',_(u"Used in land measuring. One square mile. An area of about 640 acres")],
1013                 _(u"square league (land)"):
1014                         [(m,23309892.99),'',''],
1015                 _(u"square mile"):
1016                         [(m,2.59*1e6),u"mi\xb2",''],
1017                 _(u"square kilometer"):
1018                         [(m,1e6),u"km\xb2",''],
1019                 _(u"rood"):
1020                         [(m,16*25.29285264*2.5),'',_(u"The fourth part of an acre, or forty square rods.")],
1021                 _(u"shaku"):
1022                         [(m,330.6/10000),'',_(u"A Japanese unit of area, the shaku equals 330.6 square centimeters (51.24 square inches). Note: shaku also means length and volume.")],
1023                 _(u"square chain (surveyor)"):
1024                         [(m,16*25.29285264),u"ch\xb2",_(u"A unit for land measure equal to four rods square, or one tenth of an acre.")],
1025                 _(u"link"):
1026                         [(m,4*25.29285264),'',_(u"4 rods square")],
1027                 _(u"square rod"):
1028                         [(m,25.29285264),u"rd\xb2",''],
1029                 _(u"square meter"):
1030                         [(m,1.0),u"m\xb2",_(u"Also know as a centare is (1/100th of an are).")],
1031                 _(u"square yard"):
1032                         [(m,1/1.19599004630108),u"yd\xb2",_(u"A unit of area equal to one yard by one yard square syn: sq yd")],
1033                 _(u"square foot"):
1034                         [(m,1/10.7639104167097),u"ft\xb2",_(u"An area equal to that of a square the sides of which are twelve inches; 144 square inches.")],
1035                 _(u"square inch"):
1036                         [(m,1/(10.7639104167097*144)),u"in\xb2",_(u"A unit of area equal to one inch by one inch square syn: sq in")],
1037                 _(u"square centimeter"):
1038                         [(m,1.0/10000),u"cm\xb2",''],
1039                 _(u"square micrometer"):
1040                         [(m,1.0/1e12),u"\xb5m\xb2",''],
1041                 _(u"square millimeter"):
1042                         [(m,1.0/1e6),u"mm\xb2",''],
1043                 _(u"square mil"):
1044                         [(m,1.0/(1e6*1550)),u"mil\xb2",''],
1045                 _(u"township"):
1046                         [(m,1e6*2.59*36),'',_(u"A division of territory six miles square (36miles\xb2), containing 36 sections.")],
1047                 _(u"roll (wallpaper)"):
1048                         [(m,30/10.7639104167097),'',''],
1049                 _(u"square Scottish ell"):
1050                         [(m,0.88323),'',''],
1051                 _(u"fall (Scottish)"):
1052                         [(m,31.79618),'',''],
1053                 _(u"joch (German) | yoke"):
1054                         [(m,5746.5577),'',_(u"joch (German) is 40 square klafters")],
1055                 _(u"labor (Texas)"):
1056                         [(m,716862.83837),'',_(u"An area of land that could be cultivated by one farmer")],
1057                 _(u"barony"):
1058                         [(m,16187486.47094),'',''],
1059                 _(u"square pes (Roman)"):
1060                         [(m,0.08741),'',''],
1061                 _(u"square alen (Denmark)"):
1062                         [(m,.38121),'',''],
1063                 _(u"ferfet (Iceland)"):
1064                         [(m,0.09848),'',''],
1065                 _(u"square vara (Spanish)"):
1066                         [(m,0.59418),'',''],
1067                 _(u"donum (Yugoslavia)"):
1068                         [(m,699.99992),'',''],
1069                 _(u"sahme (Egyptian)"):
1070                         [(m,7.29106),'',''],
1071                 _(u"tavola (Italian)"):
1072                         [(m,37.62587),'',''],
1073                 _(u"cuadra (Paraguay)"):
1074                         [(m,7486.71249),'',''],
1075                 _(u"acaena (Greek)"):
1076                         [(m,9.19744),'',''],
1077                 _(u"plethron (Greek)"):
1078                         [(m,951.01483),'',''],
1079         },
1080
1081         _(u"Atomic Physics"):{".base_unit":_(u"radian per second"),
1082                 _(u"kilogram"):
1083                         [(m,2.997925e8**2*(1.0/1.054e-34)),"kg",''],
1084                 _(u"joule"):
1085                         [(m,1.0/1.054e-34),'',_(u"Named after the English physicist James Prescott Joule (1818-1889). A unit of work which is equal to 10^7 units of work in the C. G. S. system of units (ergs), and is practically equivalent to the energy expended in one second by an electric current of one ampere in a resistance of one ohm. One joule is approximately equal to 0.738 foot pounds.")],
1086                 _(u"erg"):
1087                         [(m,1.0/1.054e-27),'',_(u"The unit of work or energy in the C. G. S. system, being the amount of work done by a dyne working through a distance of one centimeter; the amount of energy expended in moving a body one centimeter against a force of one dyne. One foot pound is equal to 13,560,000 ergs.")],
1088                 _(u"GeV Giga electronvolt"):
1089                         [(m,2.41796e23*2*pi),"Gev",''],
1090                 _(u"neutron mass unit"):
1091                         [(m,1.00137*1836.11*3.75577e4*13.6058*2.41796e14*2*pi),'',''],
1092                 _(u"proton mass unit"):
1093                         [(m,1836.11*3.75577e4*13.6058*2.41796e14*2*pi),'',''],
1094                 _(u"atomic mass unit"):
1095                         [(m,1822.84*3.75577e4*13.6058*2.41796e14*2*pi),"amu",''],
1096                 _(u"MeV Mega electronvolt"):
1097                         [(m,2.41796e20*2*pi),"MeV",''],
1098                 _(u"electron rest mass"):
1099                         [(m,3.75577e4*13.6058*2.41796e14*2*pi),'',''],
1100                 _(u"Rydberg constant"):
1101                         [(m,13.6058*2.41796e14*2*pi),'',_(u"Named after the Swedish physicist Johannes Robert Rydberg (1854-1919). A wave number characteristic of the wave spectrum of each element")],
1102                 _(u"electronvolt"):
1103                         [(m,2.41796e14*2*pi),"eV",_(u"A unit of energy equal to the work done by an electron accelerated through a potential difference of 1 volt.")],
1104                 _(u"kayser or cm^-1"):
1105                         [(m,2.997925e10*2*pi),"K",_('Named after the German physicist Heinrich Gustav Johannes Kayser (1853-1940). Used to measure light and other electromagnetic waves. The "wave number" in kaysers equals the number of wavelengths per centimeter.')],
1106                 _(u"kelvin"):
1107                         [(m,2.997925e8*2*pi/1.4387752e-2),"K",_(u"The basic unit of thermodynamic temperature adopted under the System International d'Unites")],
1108                 "m^-1":
1109                         [(m,2.997925e8*2*pi),'',''],
1110                 _(u"millikayser"):
1111                         [(m,2.997925e7*2*pi),'',''],
1112                 _(u"hertz"):
1113                         [(m,2*pi),"Hz",''],
1114                 _(u"radian per second"):
1115                         [(m,1.0),"rad/s",''],
1116         },
1117         _(u"Computer Data"):{".base_unit":_(u"bit"),
1118                 _(u"bit"):
1119                         [(m,1.0),'',_(u"One bit of data. Binary representation On/Off.")],
1120                 _(u"nibble | hexit | quadbit"):
1121                         [(m,4.0),'',_(u"One half a byte")],
1122                 _(u"byte"):
1123                         [(m,8.0),'',_(u"Eight bits")],
1124                 _(u"character"):
1125                         [(m,8.0),'',_('Usually described by one byte (256 possible characters can be defined by one byte).')],
1126                 _(u"kilobit"):
1127                         [(m,2.0**10.0),"kilobit",_(u"2^10 bits")],
1128                 _(u"megabit"):
1129                         [(m,2.0**20.0),"megabit",_(u"2^20 bits")],
1130                 _(u"kilobyte | kibi"):
1131                         [(m,1024.0*8),"K | Ki",_(u"2^10, 1024 bytes. 1024 comes from 2^10 which is close enough to 1000. kibi is the IEEE proposal.")],
1132                 _(u"megabyte | mebi"):
1133                         [(m,1024.0**2*8),"M | Mi",_(u"2^20, 1024^2 bytes. 1024 kilobytes. 1024 comes from 2^10 which is close enough to 1000. mebi is the IEEE proposal.")],
1134                 _(u"gigabyte | gibi"):
1135                         [(m,1024.0**3*8),"G | Gi",_(u"2^30, 1024^3. 1024 megabytes. 1024 comes from 2^10 which is close enough to 1000. gibi is the IEEE proposal.")],
1136                 _(u"terabyte | tebi"):
1137                         [(m,1024.0**4*8),"T | Ti",_(u"2^40, 1024^4. 1024 gigabytes. 1024 comes from 2^10 which is close enough to 1000. tebi is the IEEE proposal.")],
1138                 _(u"petabyte | pebi"):
1139                         [(m,1024.0**5*8),"P | Pi",_(u"2^50, 1024^5. 1024 terabytes. 1024 comes from 2^10 which is close enough to 1000. tebi is the IEEE proposal.")],
1140                 _(u"exabyte | exbi"):
1141                         [(m,1024.0**6*8),"E | Ei",_(u"2^60, 1024^6, 1024 petabytes. 1024 comes from 2^10 which is close enough to 1000. tebi is the IEEE proposal.")],
1142                 _(u"zebi | zettabyte"):
1143                         [(m,1024.0**7*8),"Zi",_(u"1024^7. 1024 exbibytes. 1024 comes from 2^10 which is close enough to 1000. tebi is the IEEE proposal.")],
1144                 _(u"yobi | yottabyte"):
1145                         [(m,1024.0**8*8),"Yi",_(u"1024^8. 1024 yobibytes. 1024 comes from 2^10 which is close enough to 1000. tebi is the IEEE proposal.")],
1146         },
1147         _(u"Computer Data flow rate"):{".base_unit":_('bits per second'),
1148                 _(u"baud:1"):
1149                         [(m,1.0),"",_(u'Symbol rate for 1 bit per symbol. Named after the French telegraph engineer Jean-Maurice-\u00C9mile Baudot (1845 - 1903). Data transmission measured in symbols per second.')],
1150                 _(u"baud:10"):
1151                         [(m,10.0),"",_(u'Symbol rate for 10 bits per symbol. Named after the French telegraph engineer Jean-Maurice-\u00C9mile Baudot (1845 - 1903). Data transmission measured in symbols per second.')],
1152                 _(u"baud:8"):
1153                         [(m,8.0),"",_(u'Symbol rate for 8 bits per symbol. Named after the French telegraph engineer Jean-Maurice-\u00C9mile Baudot (1845 - 1903). Data transmission measured in symbols per second.')],
1154                 _(u"baud:4"):
1155                         [(m,4.0),"",_(u'Symbol rate for 4 bits per symbol. Named after the French telegraph engineer Jean-Maurice-\u00C9mile Baudot (1845 - 1903). Data transmission measured in symbols per second.')],
1156                 _(u"bits per second"):
1157                         [(m,1.0),"bps",_(u" ")],
1158                 _(u"characters per second"):
1159                         [(m,10.0),"cps",_('Rate to transmit one character. The character is usually described as one byte with one stop bit and one start bit (10 bits in total).')],
1160         },
1161         _(u"Computer Numbers"):{".base_unit":_(u"base 10 decimal"),
1162                 _(u"base  2 binary"):
1163                         [(b,2),"base  2",_('Base two numbering system using the digits 0-1')],
1164                 _(u"base  3 ternary | trinary"):
1165                         [(b,3),"base  3",_(u"Base three numbering system using the digits 0-2. Russian Nikolay Brusentsov built a trinary based computer system.")],
1166                 _(u"base  4 quaternary | quadrary"):
1167                         [(b,4),"base  4",_(u"Base four numbering system using the digits 0-3.")],
1168                 _(u"base  5 quinary"):
1169                         [(b,5),"base  5",_(u"Base five numbering system using the digits 0-4.")],
1170                 _(u"base  6 senary | hexary"):
1171                         [(b,6),"base  6",_(u"Base six numbering system using the digits 0-5.")],
1172                 _(u"base  7 septenary | septary"):
1173                         [(b,7),"base  7",_(u"Base seven numbering system using the digits 0-6.")],
1174                 _(u"base  8 octonary | octal | octonal | octimal"):
1175                         [(b,8),"base  8",_(u"Base eight numbering system using the digits 0-7. Commonly used in older computer systems.")],
1176                 _(u"base  9 nonary"):
1177                         [(b,9),"base  9",_(u"Base nine numbering system using the digits 0-8.")],
1178                 _(u"base 10 decimal"):
1179                         [(b,10),"base 10",_(u"Base ten numbering system using the digits 0-9.")],
1180                 _(u"base 11 undenary"):
1181                         [(b,11),"base 11",_(u"Base eleven numbering system using the digits 0-9,a.")],
1182                 _(u"base 12 duodecimal"):
1183                         [(b,12),"base 12",_(u"Base twelve numbering system using the digits 0-9,a-b.")],
1184                 _(u"base 13 tridecimal"):
1185                         [(b,13),"base 13",_('Base Thirteen numbering system using the digits 0-9,a-c.')],
1186                 _(u"base 14 quattuordecimal"):
1187                         [(b,14),"base 14",_(u"Base Fourteen numbering system using the digits 0-9,a-d.")],
1188                 _(u"base 15 quindecimal"):
1189                         [(b,15),"base 15",_(u"Base Fifteen numbering system using the digits 0-9,a-e.")],
1190                 _(u"base 16 sexadecimal | hexadecimal | hex"):
1191                         [(b,16),"base 16",_(u"Base Sixteen numbering system using the digits 0-1,a-f. Commonly used in computer systems.")],
1192                 _(u"base 17 septendecimal"):
1193                         [(b,17),"base 17",_(u"Base Sixteen numbering system using the digits 0-1,a-g.")],
1194                 _(u"base 18 octodecimal"):
1195                         [(b,18),"base 18",_(u"Base Sixteen numbering system using the digits 0-1,a-h.")],
1196                 _(u"base 19 nonadecimal"):
1197                         [(b,19),"base 19",_(u"Base Sixteen numbering system using the digits 0-1,a-i.")],
1198                 _(u"base 20 vigesimal"):
1199                         [(b,20),"base 20",_(u"Base Twenty numbering system using the digits 0-1,a-j.")],
1200                 _(u"base 30 trigesimal"):
1201                         [(b,30),"base 30",_(u"Base Thirty numbering system using the digits 0-1,a-r.")],
1202                 _(u"base 36 hexatrigesimal"):
1203                         [(b,36),"base 36",_(u"Base Thirty-six numbering system using the digits 0-9,a-z.")],
1204                 _(u"base 40 quadragesimal"):
1205                         [(b,40),"base 40",_(u"Base Forty digits numbering system using the digits 0-1,a-f,A-C.")],
1206                 _(u"base 50 quinquagesimal"):
1207                         [(b,50),"base 50",_(u"Base Fifty digits numbering system using the digits 0-1,a-f,A-M.")],
1208                 _(u"base 60 sexagesimal"):
1209                         [(b,60),"base 60",_(u"Base Sixty numbering system using the digits 0-9,a-z,A-V.")],
1210                 _(u"base 62 duosexagesimal"):
1211                         [(b,62),"base 62",_('Base Sixty-two numbering system using the digits 0-9,a-z,A-Z. This is the highest numbering system that can be represented with all decimal numbers and lower and upper case English alphabet characters. Other number systems include septagesimal (base 70), octagesimal (base 80), nonagesimal (base 90), centimal (base 100), bicentimal (base 200), tercentimal (base 300), quattrocentimal (base 400), quincentimal (base 500).')],
1212                 _(u"roman numerals"):
1213                         [(r,0),'',_('A symbol set in the old Roman notation; I,V,X,L,C,D,M. Range 1 to 3999 (higher values cannot be represented with standard ASCII characters).')],
1214         },
1215         _('Density'):{".base_unit":_(u"kilogram/cubic meter"),
1216                 _('kilogram per cubic meter'):
1217                         [(m,1.0),u"kg/m\xb3",''],
1218                 _('kg per cubic cm'):
1219                         [(m,1.0e6),u"kg/cm\xb3",_(u"kilograms per cubic centimeter.")],
1220                 _(u"pound mass per gallon (UK)"):
1221                         [(m,99.7763664739553),"lbm/gal",_(u"Pounds mass per US liquid gallon.")],
1222                 _(u"pound mass per gallon (US)"):
1223                         [(m,119.826427316897),"lbm/gal",_(u"Pounds mass per US liquid gallon.")],
1224                 _(u"slug per cubic ft"):
1225                         [(m,515.3788),u"slug/ft\xb3",''],
1226                 _(u"gram per cubic cm "):
1227                         [(m,1000.0),u"g/cm\xb3",''],
1228                 _(u"gram per cubic meter "):
1229                         [(m,.001),u"g/m\xb3",''],
1230                 _(u"milligram/cubic meter "):
1231                         [(m,1.0e-6),u"mg/m\xb3",''],
1232                 _(u"kilogram per liter"):
1233                         [(m,1000.0),"kg/l",''],
1234                 _(u"metric ton per cubic meter"):
1235                         [(m,1000.0),u"metric ton/m\xb3",''],
1236                 _(u"pound per cubic foot"):
1237                         [(m,0.45359237/0.028316846592),u"lbm/ft\xb3",_(u"Pounds mass per cubic foot.")],
1238                 _(u"pound per cubic inch"):
1239                         [(m,0.45359237/0.000016387064),u"lbm/in\xb3",_(u"Pounds mass per cubic inch.")],
1240                 _(u"aluminum"):
1241                         [(m,2643.0),"Al",_(u"Enter 1 here to find the density of aluminum.")],
1242                 _(u"iron"):
1243                         [(m,7658.0),"Fe",_(u"Enter 1 here to find the density of iron.")],
1244                 _(u"copper"):
1245                         [(m,8906.0),"Cu",_(u"Enter 1 here to find the density of copper.")],
1246                 _(u"lead"):
1247                         [(m,11370.0),"Pb",_(u"Enter 1 here to find the density of lead.")],
1248                 _(u"gold"):
1249                         [(m,19300.0),"Au",_(u"Enter 1 here to find the density of gold.")],
1250                 _(u"silver"):
1251                         [(m,10510.0),"Ag",_(u"Enter 1 here to find the density of silver.")],
1252                 _(u"water at 4degC"):
1253                         [(m,1000.0),u"H20 at 4\xb0C",_(u"Enter 1 here to find the density of water at 4\xb0C. Water weighs 1 gram per cm\xb3.")],
1254                 _(u"ounces per gallon (UK)"):
1255                         [(m,(6.23602290462221)),_(u"oz/gal"),''],
1256                 _(u"ounces per gallon (US)"):
1257                         [(m,(7.48915170730604)),_(u"oz/gal"),''],
1258                 _(u"ton (UK | long) per cubic yard"):
1259                         [(m,2240.0 * 0.45359237/0.764554857984),u"ton/yard\xb3",''],
1260                 _(u"ton (UK | long) per cubic foot"):
1261                         [(m,2240.0 * 0.45359237/0.764554857984*27.0),u"ton/ft\xb3",''],
1262                 _(u"ton (US | short) per cubic yard"):
1263                         [(m,2000.0 * 0.45359237/0.764554857984),u"ton/yard\xb3",''],
1264                 _(u"ton (US | short) per cubic foot"):
1265                         [(m,32040.0),u"ton/ft\xb3",''],
1266         },
1267
1268         _(u"Electrical Current"):{".base_unit":_(u"ampere"),
1269                 _(u"ampere"):
1270                         [(m,1.0),"A",u"Named after the French physicist Andr\x82 Marie Amp\x82re (1775-1836). The unit of electric current; -- defined by the International Electrical Congress in 1893 and by U. S. Statute as, one tenth of the unit of current of the C. G. S. system of electro-magnetic units, or the practical equivalent of the unvarying current which, when passed through a standard solution of nitrate of silver in water, deposits silver at the rate of 0.001118 grams per second."],
1271                 _(u"kiloampere"):
1272                         [(m,1.0e3),"kA",''],
1273                 _(u"milliampere"):
1274                         [(m,1.0e-3),"mA",''],
1275                 _(u"microampere"):
1276                         [(m,1.0e-6),u"\xb5A",''],
1277                 _(u"nanoampere"):
1278                         [(m,1.0e-9),"nA",''],
1279                 _(u"picoampere"):
1280                         [(m,1.0e-12),"pA",''],
1281                 _(u"abampere"):
1282                         [(m,10.0),"abA",_(u"The CGS electromagnetic unit of current.")],
1283                 _(u"coulomb per second"):
1284                         [(m,1.0),'',''],
1285                 _(u"statampere"):
1286                         [(m,1.e-9/3),'',_(u"The CGS electrostatic unit of current.")],
1287         },
1288         _(u"Electrical Charge"):{".base_unit":_(u"coulomb"),
1289                 _(u"faraday"):
1290                         [(m,96.5e3),'',_(u"Named after Michael Faraday the The English physicist and chemist who discovered electromagnetic induction (1791-1867). The amount of electric charge that liberates one gram equivalent of any ion from an electrolytic solution. ")],
1291                 _(u"kilocoulomb"):
1292                         [(m,1.0e3),"kC",''],
1293                 _(u"ampere-hour"):
1294                         [(m,3.6e3),u"A\xb7h",_(u"Commonly used to describe the capacity of a battery.")],
1295                 _(u"abcoulomb"):
1296                         [(m,10.0),"abC",_(u"The CGS electromagnetic unit of charge.")],
1297                 _(u"coulomb (weber)"):
1298                         [(m,1.0),"C",_(u"Named after the French physicist and electrican Coulomb. (Physics) The standard unit of quantity in electrical measurements. It is the quantity of electricity conveyed in one second by the current produced by an electro-motive force of one volt acting in a circuit having a resistance of one ohm, or the quantity transferred by one amp`ere in one second. Formerly called weber.")],
1299                 _(u"microcoulomb"):
1300                         [(m,1.0e-6),u"\xb5C",''],
1301                 _(u"nanocoulomb"):
1302                         [(m,1.0e-9),"nC",''],
1303                 _(u"statcoulomb"):
1304                         [(m,1.0e-9/3),"sC",_(u"The CGS electrostatic unit of charge.")],
1305                 _(u"electron charge"):
1306                         [(m,1.0/(6.2414503832469e18)),'',''],
1307         },
1308         _(u"Electrical Voltage"):{".base_unit":_(u"volt"),
1309                 _(u"abvolt"):
1310                         [(m,1.0e-8),"abV",_(u"A unit of potential equal to one-hundred-millionth of a volt.")],
1311                 _(u"volt"):
1312                         [(m,1.0),"V",_(u"""Named after the Italian electrician Alessandro Volta. The unit of electro-motive force; -- defined by the International Electrical Congress in 1893 and by United States Statute as, that electro-motive force which steadily applied to a conductor whose resistance is one ohm will produce a current of one ampere. It is practically equivalent to 1000/1434 the electro-motive force of a standard Clark's cell at a temperature of 15deg C.""")],
1313                 _(u"gigavolt"):
1314                         [(m,1.0e9),"GV",_(u"One billion volts.")],
1315                 _(u"megavolt"):
1316                         [(m,1.0e6),"MV",_(u"One million volts.")],
1317                 _(u"kilovolt"):
1318                         [(m,1.0e3),"kV",_(u"One thousand volts.")],
1319                 _(u"millivolt"):
1320                         [(m,1.0e-3),"mV",_(u"One thousandth of an volt.")],
1321                 _(u"microvolt"):
1322                         [(m,1.0e-6),u"\xb5V",_(u"One millionth of an volt.")],
1323                 _(u"nanovolt"):
1324                         [(m,1.0e-9),"nV",_(u"One billionth of an volt.")],
1325                 _(u"statvolt"):
1326                         [(m,300.0),'',_(u"300 volts.")],
1327         },
1328         _(u"Electrical Resistance & Conductance"):{".base_unit":_(u"ohm"),
1329                 _(u"ohm"):
1330                         [(m,1.0),"ohm",_(u"Named after the German physicist Georg Simon Ohm (1787-1854). The standard unit in the measure of electrical resistance, being the resistance of a circuit in which a potential difference of one volt produces a current of one ampere. As defined by the International Electrical Congress in 1893, and by United States Statute, it is a resistance substantially equal to 10^9 units of resistance of the C.G.S. system of electro-magnetic units, and is represented by the resistance offered to an unvarying electric current by a column of mercury at the temperature of melting ice 14.4521 grams in mass, of a constant cross-sectional area, and of the length of 106.3 centimeters. As thus defined it is called the international ohm")],
1331                 _(u"siemens | mho"):
1332                         [(inv,1.0),"S",_(u"Named after Ernst Werner von Siemens (1816-1892). A unit describing how well materials conduct equal to the reciprocal of an ohm syn: mho, S")],
1333                 _(u"abmho"):
1334                         [(inv,1.0e-9),"abmho",''],
1335                 _(u"millisiemens | millimho"):
1336                         [(inv,1.0e3),"mS",''],
1337                 _(u"microsiemens | micromho"):
1338                         [(inv,1.0e6),u"\xb5S",''],
1339                 _(u"statmho"):
1340                         [(inv,8.99e11),'',''],
1341                 _(u"gigaohm"):
1342                         [(m,1.0e9),_(u"G ohm"),_(u"One billion ohms.")],
1343                 _(u"megaohm"):
1344                         [(m,1.0e6),_(u"M ohm"),_(u"One million ohms.")],
1345                 _(u"kilohm"):
1346                         [(m,1.0e3),_(u"k ohm"),_(u"One thousand ohms.")],
1347                 _(u"milliohm"):
1348                         [(m,1.0e-3),_(u"m ohm"),_(u"One thousandth of an ohm.")],
1349                 _(u"microhm"):
1350                         [(m,1.0e-6),u"\xb5 ohm",_(u"One millionth of an ohm.")],
1351                 _(u"nanohm"):
1352                         [(m,1.0e-9),"n ohm",_(u"One billionth of an ohm.")],
1353                 _(u"abohm"):
1354                         [(m,1.0e-9),"ab ohm",''],
1355                 _(u"statohm"):
1356                         [(m,8.99e5*1e6),'',''],
1357         },
1358         _(u"Electrical Inductance"):{".base_unit":_(u"henry"),
1359                 _(u"henry"):
1360                         [(m,1.0),"H",_(u"Named after the American physicist Joseph Henry (1797-1878). The unit of electric induction; the induction in a circuit when the electro-motive force induced in this circuit is one volt, while the inducing current varies at the rate of one ampere a second.")],
1361                 _(u"stathenry"):
1362                         [(m,8.99e11),'',''],
1363                 _(u"ohm-second"):
1364                         [(m,1.0),u"ohm\xb7sec",''],
1365                 _(u"millihenry"):
1366                         [(m,1.0e-3),"mH",''],
1367                 _(u"microhenry"):
1368                         [(m,1.0e-6),u"\xb5H",''],
1369                 _(u"nanohenry"):
1370                         [(m,1.0e-9),"nH",''],
1371                 _(u"abhenry"):
1372                         [(m,1.0e-9),"abH",''],
1373         },
1374         _(u"Electrical Capacitance"):{".base_unit":_(u"farad"),
1375                 _(u"farad"):
1376                         [(m,1.0),"F",_(u"Named after the English electrician Michael Faraday. The standard unit of electrical capacity; the capacity of a condenser whose charge, having an electro-motive force of one volt, is equal to the amount of electricity which, with the same electromotive force, passes through one ohm in one second; the capacity, which, charged with one coulomb, gives an electro-motive force of one volt.")],
1377                 _(u"abfarad"):
1378                         [(m,1e9),"abF",_(u"A capacitance unit equal to one billion farads")],
1379                 _(u"second/ohm"):
1380                         [(m,1.0),'',''],
1381                 _(u"microfarad"):
1382                         [(m,1e-6),u"\xb5F",''],
1383                 _(u"statfarad"):
1384                         [(m,1.0e-6/8.99e5),'',''],
1385                 _(u"nanofarad"):
1386                         [(m,1e-9),"nF",''],
1387                 _(u"picofarad"):
1388                         [(m,1e-12),"pF",''],
1389         },
1390         _(u"Electromagnetic Radiation"):{".base_unit":_(u"hertz"),
1391                 _(u"hertz"):
1392                         [(m,1.0),'Hz',_(u"""Named after the German physicist Heinrich Hertz (1857-1894) who was the first to produce electromagnetic waves artificially. Having a periodic interval of one second.""")],
1393                 _(u"meter"):
1394                         [(inv,299792458.0),"m",_(u"Equal to 39.37 English inches, the standard of linear measure in the metric system of weights and measures. It was intended to be, and is very nearly, the ten millionth part of the distance from the equator to the north pole, as ascertained by actual measurement of an arc of a meridian.")],
1395                 _(u"centimeter"):
1396                         [(inv,29979245800.0),"cm",''],
1397                 _(u"millimeter"):
1398                         [(inv,299792458000.0),"mm",''],
1399                 _(u"micrometer | micron"):
1400                         [(inv,299792458000000.0),u"\xb5m",_(u"A metric unit of length equal to one millionth of a meter. The thousandth part of one millimeter.")],
1401                 _(u"nanometer"):
1402                         [(inv,299792458000000000.0),"nm",_(u"A metric unit of length equal to one billionth of a meter.")],
1403                 _(u"angstrom"):
1404                         [(inv,2997924580000000000.0),u"\xc5",_(u"Equal to one ten billionth of a meter (or 0.0001 micron); used to specify wavelengths of electromagnetic radiation")],
1405                 _(u"kilohertz"):
1406                         [(m,1.0e3),"KHz",''],
1407                 _(u"megahertz"):
1408                         [(m,1.0e6),"MHz",''],
1409                 _(u"gigahertz"):
1410                         [(m,1.0e9),"GHz",''],
1411                 _(u"terahertz"):
1412                         [(m,1.0e12),"THz",''],
1413                 _(u"petahertz"):
1414                         [(m,1.0e15),"PHz",''],
1415                 _(u"exahertz"):
1416                         [(m,1.0e18),"EHz",''],
1417                 _(u"electron Volt"):
1418                         [(m,1/4.13566e-15),"eV",_(u"Energy. e=h\xf6f where h = Planks constant (4.13566 x 10^-15 electron volts/second). f = frequency in Hertz.")],
1419         },
1420         _(u"Energy | Work"):{".base_unit":_(u"joule | wattsecond | newton-meter"),
1421                 _(u"kiloton"):
1422                         [(m,4200.0e9),'',_(u"A measure of explosive power (of an atomic weapon) equal to that of 1000 tons of TNT")],
1423                 _(u"gigawatt-hour"):
1424                         [(m,3.6e12),"GWh",''],
1425                 _(u"megawatt-hour"):
1426                         [(m,3.6e9),"MWh",''],
1427                 _(u"kilowatt-hour"):
1428                         [(m,3.6e6),"kWh",''],
1429                 _(u"horsepower-hour"):
1430                         [(m,2.686e6),u"hp\xb7h",''],
1431                 _(u"gigajoule"):
1432                         [(m,1.0e9),"GJ",''],
1433                 _(u"megajoule"):
1434                         [(m,1.0e6),"MJ",''],
1435                 _(u"kg force meters"):
1436                         [(m,9.80665),u"kgf\xb7m",_(u"Work done by one kilogram of force acting through a distance of one meter.")],
1437                 _(u"kilojoule"):
1438                         [(m,1.0e3),"kJ",''],
1439                 _(u"watt-hour"):
1440                         [(m,3.6e3),"Wh",''],
1441                 _(u"British thermal unit"):
1442                         [(m,1.055e3),"Btu",''],
1443                 _(u"joule | wattsecond | newton-meter"):
1444                         [(m,1.0),"J",_(u"Named after the English physicist James Prescott Joule(1818-1889). A unit of work which is equal to 10^7 units of work in the C. G. S. system of units (ergs), and is practically equivalent to the energy expended in one second by an electric current of one ampere in a resistance of one ohm. One joule is approximately equal to 0.738 foot pounds.")],
1445                 _(u"kilocalorie"):
1446                         [(m,4.184e3),"kcal",''],
1447                 _(u"calorie"):
1448                         [(m,4.184),"cal",_(u"The unit of heat according to the French standard; the amount of heat required to raise the temperature of one kilogram (sometimes, one gram) of water one degree centigrade, or from 0deg to 1deg.")],
1449                 _(u"foot-poundals"):
1450                         [(m,0.04214),'',''],
1451                 _(u"foot-pound force"):
1452                         [(m,1.356),u"ft\xb7lbf",_(u"A unit of work equal to a force of one pound moving through a distance of one foot")],
1453                 _(u"millijoule"):
1454                         [(m,1.0e-3),"mJ",''],
1455                 _(u"microjoule"):
1456                         [(m,1.0e-6),u"\xb5J",''],
1457                 _(u"attojoule"):
1458                         [(m,1.0e-18),"aJ",''],
1459                 _(u"erg | dyne-centimeter"):
1460                         [(m,1.0e-7),'',_(u"The unit of work or energy in the C. G. S. system, being the amount of work done by a dyne working through a distance of one centimeter; the amount of energy expended in moving a body one centimeter against a force of one dyne. One foot pound is equal to 13,560,000 ergs.")],
1461                 _(u"GeV"):
1462                         [(m,1.0e-9/6.24),'',_(u"A billion electronvolts")],
1463                 _(u"MeV"):
1464                         [(m,1.0e-12/6.24),'',_(u"a million electronvolts")],
1465                 _(u"electron volt"):
1466                         [(m,1.0e-18/6.24),"eV",_(u"A unit of energy equal to the work done by an electron accelerated through a potential difference of 1 volt")],
1467 #1 cubic foot of natural gas ... 1,008 to 1,034 Btu 
1468                 
1469                 _(u"therm of natural gas"):
1470                         [(m,1.055e8),"",'1 therm of natural gas = 100,000 Btu'],
1471
1472                 _(u"gallon of liquefied petroleum gas"):
1473                         [(m,1.055e3*95475),"LPG",'1 gallon of liquefied petroleum gas = 95,475 Btu'],
1474                 _(u"gallon of crude oil"):
1475                         [(m,1.055e3*138095),"",'1 gallon of crude oil = 138,095 Btu'],
1476                 _(u"barrel of crude oil"):
1477                         [(m,1.055e3*5800000),"",'1 barrel of crude oil = 5,800,000 Btu'],
1478                 _(u"gallon of kerosene or light distillate oil"):
1479                         [(m,1.055e3*135000),"",'1 gallon of kerosene or light distillate oil = 135,000 Btu '],
1480                 _(u"gallon middle distillate or diesel fuel oil"):
1481                         [(m,1.055e3*138690),"",'1 gallon middle distillate or diesel fuel oil = 138,690 Btu '],
1482
1483
1484                 _(u"gallon residential fuel oil"):
1485                         [(m,1.055e3*149690),"",'1 gallon residential fuel oil = 149,690 Btu'],
1486                 _(u"gallon of gasoline"):
1487                         [(m,1.055e3*125000),"",'1 gallon of gasoline = 125,000 Btu'],
1488                 _(u"gallon of ethanol"):
1489                         [(m,1.055e3*84400),"",'1 gallon of ethanol = 84,400 Btu'],
1490                 _(u"gallon of methanol"):
1491                         [(m,1.055e3*62800),"",'1 gallon of methanol = 62,800 Btu'],
1492                 _(u"gallon gasohol (10% ethanol, 90% gasoline)"):
1493                         [(m,1.055e3*120900),"",'1 gallon gasohol (10% ethanol, 90% gasoline) = 120,900 Btu'],
1494 #               _(u"pound of coal"):
1495 #                       [(m,1.055e3),"",'pound of coal = 8,100-13,000 Btu'],
1496 #               _(u"ton of coal"):
1497 #                       [(m,1.055e3),"",'1 ton of coal = 16,200,00-26,000,000 Btu'],
1498                 _(u"ton of coke"):
1499                         [(m,1.055e3*26000000),"",'1 ton of coke = 26,000,000 Btu'],
1500 # 1 ton of wood = 9,000,00-17,000,000 Btu
1501 #               _(u""):
1502 #                       [(m,1.055e3),"",''],
1503 # 1 standard cord of wood = 18,000,000-24,000,000 Btu
1504 #               _(u""):
1505 #                       [(m,1.055e3),"",''],
1506 # 1 face cord of wood = 6,000,000-8,000,000 Btu
1507 #               _(u""):
1508 #                       [(m,1.055e3),"",''],
1509
1510 # GJ to therm and MBTUs would be nice too.
1511                 _(u"therm"):
1512                         [(m,1.055e-3*10000),"",'10^5 BTUs'],
1513
1514
1515                 _(u"Mega British thermal unit"):
1516                         [(m,1.055e-3),"MBtu",'Million British thermal units'],
1517
1518                 _(u"pound of carbon (upper heating value)"):
1519                         [(m,1.055e3*14550),"",'1 pound of carbon is 14,550 btu (upper heating value).'],
1520
1521         },
1522         _(u"Flow (dry)"):{".base_unit":"litres per second",
1523                 _(u"litres per second"):
1524                         [(m,1.0),"lps",_(u"A cubic decimeter of material moving past a point every second.")],
1525                 _(u"litres per minute"):
1526                         [(m,1.0/60),"lpm",_(u"A cubic decimeter of material moving past a point every minute.")],
1527                 _(u"cubic feet per minute"):
1528                         [(m,1/(60*0.0353146667215)),"cfm",_(u"Commonly used to describe the flow rate produced by a large fan or blower.")],
1529                 _(u"cubic feet per second"):
1530                         [(m,1/0.0353146667215),"cfs",''],
1531                 _(u"cubic inches per minute"):
1532                         [(m,1/(60*61.0237440947)),u"in\xb3/m",''],
1533                 _(u"cubic inches per second"):
1534                         [(m,1/61.0237440947),u"in\xb3/s",''],
1535         },
1536         _(u"Flow (liquid)"):{".base_unit":"litres per second",
1537                 _(u"litres per second"):
1538                         [(m,1.0),"lps",_(u"A cubic decimeter of material moving past a point every second")],
1539                 _(u"litres per minute"):
1540                         [(m,1.0/60),"lpm",''],
1541                 _(u"US gallons per minute"):
1542                         [(m,1/(60*3.785411784)),"gpm (US)",''],
1543                 _(u"US gallons per second"):
1544                         [(m,1/3.785411784),"gps (US)",''],
1545                 _(u"UK gallons per minute"):
1546                         [(m,1/(60*4.54609028199)),"gpm (UK)",''],
1547                 _(u"UK gallons per second"):
1548                         [(m,1/4.54609028199),"gps (UK)",''],
1549         },
1550         _(u"Force"):{".base_unit":"newton",
1551                 _(u"tonne of force"):
1552                         [(m,9806.65),'',_(u"Metric ton of force, 1000 kilonewtons.")],
1553                 _(u"ton of force"):
1554                         [(m,2000*4.4482216152605),"tnf",_(u"2000 pounds of force.")],
1555                 _(u"sthene"):
1556                         [(m,1.0e3),'',_(u"Named from the Greek word sthenos, strength. One sthene is the force required to accelerate a mass of one tonne at a rate of 1 m/s2. ")],
1557                 _(u"atomic weight"):
1558                         [(m,1.6283353926E-26),'',_(u"Generally understood as the weight of the hydrogen atom.")],
1559                 _(u"kip"):
1560                         [(m,4.4482216152605e3),'',_(u"Kilopounds of force.")],
1561                 _(u"kilonewton"):
1562                         [(m,1.0e3),"kN",''],
1563                 _(u"kilogram force | kilopond"):
1564                         [(m,9.80665),"kgf",''],
1565                 _(u"pound force"):
1566                         [(m,4.4482216152605),"lbf",''],
1567                 _(u"newton"):
1568                         [(m,1.0),"N",_(u"Named after the English mathematician and physicist Sir Isaac Newton (1642-1727). A unit of force equal to the force that imparts an acceleration of 1 m/sec\xb2 to a mass of 1 kilogram; equal to 100,000 dynes")],
1569                 _(u"ounce force"):
1570                         [(m,4.4482216152605/16),"ozf",''],
1571                 _(u"poundal"):
1572                         [(m,0.138254954376),"pdl",_(u"A unit of force based upon the pound, foot, and second, being the force which, acting on a pound avoirdupois for one second, causes it to acquire by the of that time a velocity of one foot per second. It is about equal to the weight of half an ounce, and is 13,825 dynes.")],
1573                 _(u"gram force"):
1574                         [(m,9.80665/1e3),"gf",''],
1575                 _(u"millinewton"):
1576                         [(m,1.0e-3),"mN",''],
1577                 _(u"dyne"):
1578                         [(m,1.0e-5),"dyn",_(u"The unit of force, in the C. G. S. (Centimeter Gram Second) system of physical units; that is, the force which, acting on a gram for a second, generates a velocity of a centimeter per second.")],
1579                 _(u"micronewton"):
1580                         [(m,1.0e-6),u"\xb5N",''],
1581         },
1582         _(u"Length"):{".base_unit":"meter",
1583                 _(u"klafter | faden (German)"):
1584                         [(m,1.8965),'',_(u"Similar to the fathom.")],
1585                 _(u"klafter | faden (Switzerland)"):
1586                         [(m,1.8),'',_(u"Similar to the fathom.")],
1587                 _(u"earth diamater"):
1588                         [(m,12742630),'',_(u"Diameter for the Earth.")],
1589                 _(u"actus (roman actus)"):
1590                         [(m,35.47872),'',_(u"Land measurement, 120 Roman feet (pedes monetales). This was equivalent to 35.47872 meters.")],
1591                 _(u"angstrom"):
1592                         [(m,1.0e-10),u"\xc5",_(u"Equal to one ten billionth of a meter (or 0.0001 micron); used to specify wavelengths of electromagnetic radiation")],
1593                 _(u"arshin | arshine | archin"):
1594                         [(m,0.7112),'',_(u"Russian.  28 inches")],
1595                 _(u"arpentcan"):
1596                         [(m,44289.14688),'',_(u"arpentcan = 27.52 mile")],
1597                 _(u"arpent (Canadian)"):
1598                         [(m,58.471308),'',_(u"Canadian unit of land measurement. 191.835 ft")],
1599                 _(u"arpentlin | French arpent"):
1600                         [(m,30*6.395*12*(25.4/1000)),'',_(u"French unit of land measurement. 30 toises")],
1601                 _(u"assbaa"):
1602                         [(m,0.02),'',_(u"Arabian measure.")],
1603                 _(u"astronomical unit"):
1604                         [(m,149597871000.0),"AU",_(u"Used for distances within the solar system; equal to the mean distance between the Earth and the Sun (approximately 93 million miles or 150 million kilometers).")],
1605                 _(u"barleycorn"):
1606                         [(m,8.46666666666667E-03),'',_(u"Formerly, a measure of length, equal to the average length of a grain of barley; the third part of an inch.")],
1607                 _(u"bohr radius"):
1608                         [(m,52.9177/1e12),'',_(u"Named after the Danish physicist Niels Bohr (1885-1962), who explained the structure of atoms in 1913. The bohr radius represents the mean distance between the proton and the electron in an unexcited hydrogen atom. 52.9177 picometers. ")],
1609                 _(u"bolt"):
1610                         [(m,36.576),'',_(u"A compact package or roll of cloth, as of canvas or silk, often containing about forty yards.")],
1611                 _(u"bottom measure"):
1612                         [(m,(25.4/1000)/40),'',_(u"One fortieth of an inch.")],
1613                 _(u"cable length"):
1614                         [(m,219.456),'',_(u"A nautical unit of depth. 720 feet.")],
1615                 _(u"caliber (gun barrel caliber)"):
1616                         [(m,0.000254),'',_(u"The diameter of round or cylindrical body, as of a bullet or column.")],
1617                 _(u"cane"):
1618                         [(m,3.84049),'',_(u"Persian")],
1619                 _(u"chain (surveyors | Gunters)"):
1620                         [(m,20.1168),'',_(u"A surveyors instrument which consists of links and is used in measuring land.One commonly in use is Gunter's chain, which consists of one hundred links, each link being seven inches and ninety-two one hundredths in length; making up the total length of rods, or sixty-six, feet; hence, a measure of that length; hence, also, a unit for land measure equal to four rods.")],
1621                 _(u"chain (engineers)"):
1622                         [(m,100*(12*25.4/1000)),'',_(u"100 ft.")],
1623                 _(u"charac"):
1624                         [(m,0.2601),'',_(u"Persian")],
1625                 _(u"chebel"):
1626                         [(m,21.03124),'',_(u"Persian")],
1627                 _(u"city block"):
1628                         [(m,100*(36*25.4/1000)),'',_(u"An informal measurement, about 100 yards")],
1629                 _(u"cubit (Biblical | Hebrew | English)"):
1630                         [(m,18.00*(25.4/1000)),'',_(u"A measure of length, being the distance from the elbow to the extremity of the middle finger. Note: The cubit varies in length in different countries, the English,Hebrew and Biblical cubits are 18 inches.")],
1631                 _(u"cubit (Indian) | hasta"):
1632                         [(m,0.64161),'',''],
1633                 _(u"cubit (Roman)"):
1634                         [(m,17.47*(25.4/1000)),'',_(u"A measure of length, being the distance from the elbow to the extremity of the middle finger. Note: The cubit varies in length in different countries, the Roman cubit is 17.47 inches.")],
1635                 _(u"cubit (Greek) | pechya"):
1636                         [(m,18.20*(25.4/1000)),'',_(u"A measure of length, being the distance from the elbow to the extremity of the middle finger. Note: The cubit varies in length in different countries, the Greek cubit is 18.20 inches.")],
1637                 _(u"cubit (Israeli)"):
1638                         [(m,0.55372),'',_(u"A measure of length, being the distance from the elbow to the extremity of the middle finger. Note: The cubit varies in length in different countries, the Israeli cubit is 21.8 inches.")],
1639                 _(u"cloth finger"):
1640                         [(m,4.5*(25.4/1000)),'',_(u"Used in sewing")],
1641                 _(u"cloth quarter"):
1642                         [(m,9*(25.4/1000)),'',_(u"Used in sewing")],
1643                 _(u"compton wavelength of the electron"):
1644                         [(m,1836.11*1.00138*1.31962/1e15),'',_(u"Named after Arthur Holly Compton (1892-1962)")],
1645                 _(u"compton wavelength of the proton"):
1646                         [(m,1.00138*1.31962/1e15),'',_(u"Named after Arthur Holly Compton (1892-1962)")],
1647                 _(u"compton wavelength of the neutron"):
1648                         [(m,1.31962/1e15),'',_(u"Named after Arthur Holly Compton (1892-1962)")],
1649                 _(u"classical electron radius"):
1650                         [(m,2.13247*1.00138*1.31962/1e15),'',''],
1651                 _(u"digit | digitus"):
1652                         [(m,0.018542),'',_(u"A finger's breadth, commonly estimated to be three fourths of an inch.")],
1653                 _(u"decimeter"):
1654                         [(m,1.0e-1),"dm","""The tenth part of a meter; a measure of length equal to rather more than 3.937 of an inch."""],
1655                 _(u"diamond (Typographical)"):
1656                         [(m,4.5*0.35146e-3),'',_(u"4 1/2 pt in height.")],
1657                 _(u"pearl (Typographical)"):
1658                         [(m,5*0.35146e-3),'',_(u"5 pt in height.")],
1659                 _(u"agate | ruby (Typographical)"):
1660                         [(m,5.5*0.35146e-3),'',_(u"Used in typing. A kind of type, larger than pearl and smaller than nonpareil; in England called ruby. 5 1/2 pt in height.")],
1661                 _(u"nonpareil (Typographical)"):
1662                         [(m,6*0.35146e-3),'',_(u"6 pt in height.")],
1663                 _(u"minion (Typographical)"):
1664                         [(m,7*0.35146e-3),'',_(u"7 pt in height.")],
1665                 _(u"brevier (Typographical)"):
1666                         [(m,8*0.35146e-3),'',_(u"8 pt in height.")],
1667                 _(u"bourgeois (Typographical)"):
1668                         [(m,9*0.35146e-3),'',_(u"9 pt in height.")],
1669                 _(u"elite | long primer (Typographical)"):
1670                         [(m,10*0.35146e-3),'',_(u"10 pt in height.")],
1671                 _(u"small pica (Typographical)"):
1672                         [(m,11*0.35146e-3),'',_(u"11 pt in height.")],
1673                 _(u"pica (Typographical)"):
1674                         [(m,12*0.35146e-3),'',_(u"A size of type next larger than small pica, and smaller than English.12 pt in height")],
1675                 _(u"english (Typographical)"):
1676                         [(m,14*0.35146e-3),'',_(u"14 pt in height.")],
1677                 _(u"columbian (Typographical)"):
1678                         [(m,16*0.35146e-3),'',_(u"16 pt in height.")],
1679                 _(u"great primer (Typographical)"):
1680                         [(m,18*0.35146e-3),'',_(u"18 pt in height.")],
1681                 _(u"point (pica) (Typographical)"):
1682                         [(m,0.35146e-3),"pt",_(u"Typographical measurement. This system was developed in England and is used in Great-Britain and the US. 1 pica equals 12 pica points.")],
1683                 _(u"point (didot) (Typographical)"):
1684                         [(m,0.376065e-3),"pt",_(u"Typographical measurement. The didot system originated in France but was used in most of Europe")],
1685                 _(u"cicero (Typographical)"):
1686                         [(m,12*0.376065e-3),'',_(u"Typographical measurement. 1 cicero equals 12 didot points.")],
1687                 _(u"point (PostScript) (Typographical)"):
1688                         [(m,(25.4/1000)/72),"pt",_(u"Typographical measurement. Created by Adobe. There are exactly 72 PostScript points in 1 inch.")],
1689
1690                 _(u"ell (English)"):
1691                         [(m,45*(25.4/1000)),'',_(u"A measure for cloth; -- now rarely used. It is of different lengths in different countries; the English ell being 45 inches, the Dutch or Flemish ell 27, the Scotch about 37.")],
1692                 _(u"ell (Dutch | Flemish)"):
1693                         [(m,27*(25.4/1000)),'',_(u"A measure for cloth; -- now rarely used. It is of different lengths in different countries; the English ell being 45 inches, the Dutch or Flemish ell 27, the Scotch about 37.")],
1694                 _(u"ell (Scotch)"):
1695                         [(m,37*(25.4/1000)),'',_(u"A measure for cloth; -- now rarely used. It is of different lengths in different countries; the English ell being 45 inches, the Dutch or Flemish ell 27, the Scotch about 37.")],
1696                 _(u"em"):
1697                         [(m,0.0003514598),'',_(u"Used in typography. A quadrat, the face or top of which is a perfect square; also, the size of such a square in any given size of type, used as the unit of measurement for that type: 500 m's of pica would be a piece of matter whose length and breadth in pica m's multiplied together produce that number.")],
1698                 _(u"en"):
1699                         [(m,0.0001757299),'',_(u"Used in typography. Half an em, that is, half of the unit of space in measuring printed matter.")],
1700                 _(u"fathom"):
1701                         [(m,6*(12*25.4/1000)),'',_(u"6 feet. Approximately the space to which a man can extend his arms.")],
1702                 _(u"fathom (Greek)"):
1703                         [(m,4*18.20*(25.4/1000)),'',_(u"4 Greek cubits.")],
1704                 _(u"fermi"):
1705                         [(m,1e-15),'',_(u"a metric unit of length equal to one quadrillionth of a meter ")],
1706                 _(u"finger breadth"):
1707                         [(m,0.875*(25.4/1000)),'',_(u"The breadth of a finger, or the fourth part of the hand; a measure of nearly an inch.")],
1708                 _(u"finger length"):
1709                         [(m,4.5*(25.4/1000)),'',_(u"The length of finger, a measure in domestic use in the United States, of about four and a half inches or one eighth of a yard.")],
1710                 _(u"foot"):
1711                         [(m,12*(25.4/1000)),"ft",_(u"Equivalent to twelve inches; one third of a yard. This measure is supposed to be taken from the length of a man's foot.")],
1712                 _(u"foot (Assyrian)"):
1713                         [(m,2.63042),'',''],
1714                 _(u"foot (Arabian)"):
1715                         [(m,0.31919),'',''],
1716                 _(u"foot (Roman) | pes"):
1717                         [(m,0.2959608),'',''],
1718                 _(u"foot (geodetic | survey)"):
1719                         [(m,1200.0/3937),'',_(u"A former U.S. definition of the foot as exactly 1200/3937 meter or about 30.48006096 centimeters. This was the official U.S. definition of the foot from 1866 to 1959; it makes the meter equal exactly 39.37 inches. In 1959 the survey foot was replaced by the international foot, equal to exactly 30.48 centimeters. However, the survey foot remains the basis for precise geodetic surveying in the U.S.")],
1720                 _(u"furlong"):
1721                         [(m,40*5.0292),'','The eighth part of a mile; forty rods; two hundred and twenty yards. From the Old English fuhrlang, meaning "the length of a furrow".'],
1722                 _(u"ghalva"):
1723                         [(m,230.42925),'',_(u"Arabian measure")],
1724                 _(u"gradus (Roman)"):
1725                         [(m,2.43*(12*25.4/1000)),'',''],
1726                 _(u"hand"):
1727                         [(m,0.1016),'',_(u"A measure equal to a hand's breadth, -- four inches; a palm. Chiefly used in measuring the height of horses.")],
1728                 _(u"inch"):
1729                         [(m,(25.4/1000)),"in",_(u"The twelfth part of a foot, commonly subdivided into halves, quarters, eights, sixteenths, etc., as among mechanics. It was also formerly divided into twelve parts, called lines, and originally into three parts, called barleycorns, its length supposed to have been determined from three grains of barley placed end to end lengthwise.")],
1730                 _(u"ken"):
1731                         [(m,2.11836),'',_(u"Japanese fathom. The ken is the length of a traditional tatami mat.")],
1732                 _(u"league (land | statute)"):
1733                         [(m,3*1609.344),'',_(u" Used as a land measure. 3 statute miles.")],
1734                 _(u"league (nautical)"):
1735                         [(m,3*1852),'',_(u" Used as a marine measure. 3 nautical miles.")],
1736                 _(u"li"):
1737                         [(m,644.652),'',_(u"A Chinese measure of distance, being a little more than one third of a mile.")],
1738                 _(u"light second"):
1739                         [(m,299792458),'',_(u"The distance over which light can travel in one second; -- used as a unit in expressing stellar distances.")],
1740                 _(u"light year"):
1741                         [(m,9.460528405106E+15),'',_(u"The distance over which light can travel in a year's time; -- used as a unit in expressing stellar distances. It is more than 63,000 times as great as the distance from the earth to the sun.")],
1742                 _(u"line"):
1743                         [(m,(25.4/1000)/12),'',_(u"A measure of length; one twelfth of an inch.")],
1744                 _(u"link (Gunters | surveyors)"):
1745                         [(m,0.201168),'',_(u"""Part of a surveyors instrument (chain) which consists of links and is used in measuring land. One commonly in use is Gunter's chain, which consists of one hundred links, each link being 7.92" in length.""")],
1746                 _(u"link (US | engineers)"):
1747                         [(m,12*(25.4/1000)),'',_(u"Used by surveyors. In the U.S., where 100-foot chains are more common, the link is the same as the foot. ")],
1748                 _(u"marathon"):
1749                         [(m,42194.988),'',_(u"a footrace of 26 miles 385 yards")],
1750
1751                 _(u"megameter"):
1752                         [(m,1.0e6),'',_(u"In the metric system, one million meters, or one thousand kilometers.")],
1753                 _(u"kilometer"):
1754                         [(m,1.0e3),"km",_(u"Being a thousand meters. It is equal to 3,280.8 feet, or 62137 of a mile.")],
1755                 _(u"meter"):
1756                         [(m,1.0),"m",_(u"Equal to 39.37 English inches, the standard of linear measure in the metric system of weights and measures. It was intended to be, and is very nearly, the ten millionth part of the distance from the equator to the north pole, as ascertained by actual measurement of an arc of a meridian.")],
1757                 _(u"centimeter"):
1758                         [(m,1.0e-2),"cm",_(u"""The hundredth part of a meter; a measure of length equal to rather more than thirty-nine hundredths (0.3937) of an inch.""")],
1759                 _(u"millimeter"):
1760                         [(m,1.0e-3),"mm",_(u"A lineal measure in the metric system, containing the thousandth part of a meter; equal to .03937 of an inch.")],
1761                 _(u"micrometer | micron"):
1762                         [(m,1.0e-6),u"\xb5m",_(u"A metric unit of length equal to one millionth of a meter. The thousandth part of one millimeter.")],
1763                 _(u"nanometer"):
1764                         [(m,1.0e-9),"nm",_(u"A metric unit of length equal to one billionth of a meter.")],
1765                 _(u"picometer"):
1766                         [(m,1.0e-12),'',_(u"A metric unit of length equal to one trillionth of a meter.")],
1767                 _(u"femtometer"):
1768                         [(m,1.0e-15),'',_(u"A metric unit of length equal to one quadrillionth of a meter.")],
1769
1770                 _(u"mil"):
1771                         [(m,(25.4/1e6)),"mil",_(u"Equal to one thousandth of an inch; used to specify thickness (e.g., of sheets or wire)")],
1772                 _(u"mile (Roman)"):
1773                         [(m,1479.804),'',_(u"5000 Roman feet.")],
1774                 _(u"mile (statute)"):
1775                         [(m,1609.344),"mi",_(u"Mile is from the Latin word for 1000 (mille). A mile conforming to statute, that is, in England and the United States, a mile of 5,280 feet, as distinguished from any other mile.")],
1776                 _(u"mile (nautical | geographical)"):
1777                         [(m,1852.0),"nmi",_(u"Geographical, or Nautical mile, one sixtieth of a degree of a great circle of the earth, or about 6080.27 feet.")],
1778                 _(u"nail (cloth)"):
1779                         [(m,0.05715),'',_(u"Used for measuring cloth. 1/20 ell. The length of the last two joints (including the fingernail) of the middle finger. The nail is equivalent to 1/16 yard, 1/4 span.")],
1780                 _(u"naval shot"):
1781                         [(m,15*6*(12*25.4/1000)),'',_(u"Equal to 15 fathoms")],
1782                 _(u"pace"):
1783                         [(m,2.5*(12*25.4/1000)),'',_(u"The length of a step in walking or marching, reckoned from the heel of one foot to the heel of the other. Note: Ordinarily the pace is estimated at two and one half linear feet.")],
1784                 _(u"pace (Roman) | passus"):
1785                         [(m,5*0.2959608),'',_(u" The Roman pace (passus) was from the heel of one foot to the heel of the same foot when it next touched the ground, five Roman feet.")],
1786                 _(u"pace (quick-time marching)"):
1787                         [(m,30*(25.4/1000)),'',_(u"The regulation marching pace in the English and United States armies is thirty inches for quick time.")],
1788                 _(u"pace (double-time marching)"):
1789                         [(m,36*(25.4/1000)),'',_(u"The regulation marching pace in the English and United States armies is thirty-six inches for double time. ")],
1790                 _(u"palm (Greek)"):
1791                         [(m,7.71313333333333e-02),'',_(u"A lineal measure equal either to the breadth of the hand or to its length from the wrist to the ends of the fingers; a hand; -- used in measuring a horse's height. In Greece, the palm was reckoned at three inches. At the present day, this measure varies in the most arbitrary manner, being different in each country, and occasionally varying in the same. One third of a Greek span,")],
1792                 _(u"palm (Roman lesser)"):
1793                         [(m,2.91*(25.4/1000)),'',_(u"A lineal measure equal either to the breadth of the hand or to its length from the wrist to the ends of the fingers; a hand; -- used in measuring a horse's height. One of two Roman measures of the palm, the lesser palm is 2.91 inches. At the present day, this measure varies in the most arbitrary manner, being different in each country, and occasionally varying in the same.")],
1794                 _(u"palm (Roman greater)"):
1795                         [(m,8.73*(25.4/1000)),'',_(u"A lineal measure equal either to the breadth of the hand or to its length from the wrist to the ends of the fingers; a hand; -- used in measuring a horse's height. One of two Roman measures of the palm, the greater palm is 8.73 inches. At the present day, this measure varies in the most arbitrary manner, being different in each country, and occasionally varying in the same.")],
1796                 _(u"parasang"):
1797                         [(m,3.5*1609.344),'',_(u"A Persian measure of length, which, according to Herodotus and Xenophon, was thirty stadia, or somewhat more than three and a half miles. The measure varied in different times and places, and, as now used, is estimated at three and a half English miles.")],
1798                 _(u"parsec"):
1799                         [(m,3.08567758767931e16),'',_(u"A unit of astronomical length based on the distance from  Earth at which stellar parallax is 1 second of arc; equivalent to 3.262 light years")],
1800                 _(u"rod | pole | perch"):
1801                         [(m,5.0292),'',_(u"Containing sixteen and a half feet; -- called also perch, and pole.")],
1802                 _(u"ri"):
1803                         [(m,3926.79936),'',_(u"Japanese league.")],
1804                 _(u"rope"):
1805                         [(m,20*12*(25.4/1000)),'',_(u"20 feet")],
1806                 _(u"sadzhens | sagene | sazhen"):
1807                         [(m,2.10312),'',_(u"Russian and East European. Used in previous centuries (until WWI or WWII). The distance between a grown man's spread of arms , from the finger- tips of one to hand to the finger-tips of the other hand. Equal to about 7 feet long (2.13 m).")],
1808                 _(u"shaku"):
1809                         [(m,0.303022),'',_(u" A Japanese foot. Note: shaku also means area and volume.")],
1810                 _(u"skein"):
1811                         [(m,120*3*12*(25.4/1000)),'',_(u"120 yards. A skein of cotton yarn is formed by eighty turns of the thread round a fifty-four inch reel.")],
1812                 _(u"soccer field"):
1813                         [(m,100*3*12*(25.4/1000)),'',_(u"100 yards")],
1814                 _(u"solar diameter"):
1815                         [(m,1391900000),'',_(u"Diameter of our sun.")],
1816                 _(u"span (Greek)"):
1817                         [(m,0.231394),'',_(u"To measure by the span of the hand with the fingers extended, or with the fingers encompassing the object; as, to span a space or distance; to span a cylinder. One half of a Greek cubit.")],
1818                 _(u"span (cloth)"):
1819                         [(m,9*(25.4/1000)),'',_(u"9 inches")],
1820                 _(u"spindle (cotten yarn)"):
1821                         [(m,15120*3*12*(25.4/1000)),'',_(u"A cotten yarn measure containing 15,120 yards.")],
1822                 _(u"spindle (linen yarn)"):
1823                         [(m,14400*3*12*(25.4/1000)),'',_(u"A linen yarn measure containing 14,400 yards.")],
1824                 _(u"stadia (Greek) | stadion"):
1825                         [(m,185.1152),'',_(u"A Greek measure of length, being the chief one used for itinerary distances, also adopted by the Romans for nautical and astronomical measurements. It was equal to 600 Greek or 625 Roman feet, or 125 Roman paces, or to 606 feet 9 inches English. This was also called the Olympic stadium, as being the exact length of the foot-race course at Olympia.")],
1826                 _(u"stadium (Persian)"):
1827                         [(m,214.57962),'',''],
1828                 _(u"stadium (Roman)"):
1829                         [(m,184.7088),'',_(u"A Greek measure of length, being the chief one used for itinerary distances, also adopted by the Romans for nautical and astronomical measurements. It was equal to 600 Greek or 625 Roman feet, or 125 Roman paces, or to 606 feet 9 inches English. This was also called the Olympic stadium, as being the exact length of the foot-race course at Olympia.")],
1830                 _(u"sun (Japanese)"):
1831                         [(m,0.0303022),'',_(u"Japanese measurement.")],
1832                 _(u"toise (French)"):
1833                         [(m,6.395*12*(25.4/1000)),'',_(u"French fathom.")],
1834                 _(u"vara (Spanish)"):
1835                         [(m,33.385*(25.4/1000)),'',_(u"A Spanish measure of length equal to about one yard. 33.385 inches. ")],
1836                 _(u"vara (Mexican)"):
1837                         [(m,0.837946),'',_(u"A Mexican measure of length equal to about one yard. 32.99 inches. ")],
1838                 _(u"verst | werst"):
1839                         [(m,3500*12*(25.4/1000)),'',_(u"A Russian measure of length containing 3,500 English feet.")],
1840                 _(u"yard"):
1841                         [(m,3*12*(25.4/1000)),"yd",_(u"Equaling three feet, or thirty-six inches, being the standard of English and American measure.")],
1842         },
1843         _(u"Luminance"):{".base_unit":"candela per square meter",
1844                 _(u"magnitudes per square arcsecond"):
1845                         [(f,('108000*(10**(-0.4*x))','log((x/108000),10)/-0.4')),"mags/arcsec2",_(u"Used by astronomers to define the darkness of the night sky. Stars are rated by brightness in magnitudes . A lower magnitude number is a brighter star. The star Vega has a magnitude of zero, and a measurement of 0 magnitudes per square arcsecond would be like having every square arcsecond in the sky will with the brightness of the star Vega.")],
1846                 _(u"candela per square centimeter"):
1847                         [(m,1.0e4),u"cd/cm\xb2",''],
1848                 _(u"kilocandela per square meter"):
1849                         [(m,1.0e3),u"kcd/m\xb2",''],
1850                 _(u"stilb"):
1851                         [(m,1.0e4),"sb",'From a Greek word stilbein meaning "to glitter". Equal to one candela per square centimeter or 104 nits.'],
1852                 _(u"lambert"):
1853                         [(m,3183.09886183791),"L",_(u"Named after the German physicist Johann Heinrich Lambert (1728-1777).Equal to the brightness of a perfectly diffusing surface that emits or reflects one lumen per square centimeter")],
1854                 _(u"candela per square inch"):
1855                         [(m,1550.0031000062),u"cd/in\xb2",''],
1856                 _(u"candela per square foot"):
1857                         [(m,10.7639104167097),u"cd/ft\xb2",''],
1858                 _(u"foot lambert"):
1859                         [(m,3.42625909963539),"fL",''],
1860                 _(u"millilambert"):
1861                         [(m,3.18309886183791),"mL",''],
1862                 _(u"candela per square meter"):
1863                         [(m,1.0),u"cd/m\xb2",''],
1864                 _(u"lumen per steradian square meter"):
1865                         [(m,1.0),'',''],
1866                 _(u"nit"):
1867                         [(m,1.0),'',_(u"Named from the Latin niteo, to shine.")],
1868                 _(u"apostilb"):
1869                         [(m,3.18309886183791/10),"asb",'Named from the Greek stilbein, to "glitter" or "shine," with the prefix apo-, "away from." '],
1870         },
1871         _(u"Illumination"):{".base_unit":"lux",
1872                 _(u"phot"):
1873                         [(m,1.0e4),"ph",_(u"a unit of illumination equal to 1 lumen per square centimeter; 10,000 phots equal 1 lux")],
1874                 _(u"lumen per square centimeter"):
1875                         [(m,1.0e4),u"lm/cm\xb2",''],
1876                 _(u"foot candle"):
1877                         [(m,10.7639104167097),"fc",''],
1878                 _(u"lumen per square foot"):
1879                         [(m,10.7639104167097),u"lm/ft\xb2",''],
1880                 _(u"lux"):
1881                         [(m,1.0),"lx",_(u"Equal to the illumination produced by luminous flux of one lumen falling perpendicularly on a surface one meter square. Also called meter-candle.")],
1882                 _(u"metre-candle"):
1883                         [(m,1.0),"m-cd",_(u"Equal to the illumination produced by luminous flux of one lumen falling perpendicularly on a surface one meter square. Also called lux.")],
1884                 _(u"lumen per square meter"):
1885                         [(m,1.0),u"lm/m\xb2",''],
1886                 _(u"candela steradian per square meter"):
1887                         [(m,1.0),'',''],
1888         },
1889         _(u"Luminous Intensity (point sources)"):{".base_unit":"candela",
1890                 _(u"candela"):
1891                         [(m,1.0),"cd",_(u"The basic unit of luminous intensity adopted under the System International d'Unites; equal to 1/60 of the luminous intensity per square centimeter of a blackbody radiating at the temperature of 2,046 degrees Kelvin syn: candle, cd, standard candle.")],
1892                 _(u"lumen per steradian"):
1893                         [(m,1.0),"lm/sr",''],
1894                 _(u"hefner candle"):
1895                         [(m,0.92),"HC",_(u"Named after F. von Hefner-Altenack (1845-1904)")],
1896         },
1897         _(u"Luminous Flux"):{".base_unit":"lumen",
1898                 _(u"lumen"):
1899                         [(m,1.0),"lm",_(u"Equal to the luminous flux emitted in a unit solid angle by a point source of one candle intensity")],
1900                 _(u"candela steradian"):
1901                         [(m,1.0),u"cd\xb7sr",''],
1902         },
1903         _(u"Magnetomotive force"):{".base_unit":"ampere",
1904                 _(u"ampere"):
1905                         [(m,1.0),"A",''],
1906                 _(u"ampere-turn"):
1907                         [(m,1.0),"At",_(u"A unit of magnetomotive force equal to the magnetomotive force produced by the passage of 1 ampere through 1 complete turn of a coil.")],
1908                 _(u"gilbert"):
1909                         [(m,0.795775),"Gb",_(u"Named after the English scientist William Gilbert (1544-1603)")],
1910                 _(u"kiloampere"):
1911                         [(m,1e3),"kA",''],
1912                 _(u"oersted-centimeter"):
1913                         [(m,0.795775),'',_(u"The same value as the gilbert.")],
1914         },
1915         _(u"Magnetic Flux"):{".base_unit":"weber",
1916                 _(u"weber"):
1917                         [(m,1.0),"Wb",_(u"From the name of Professor Weber, a German electrician. One volt second.")],
1918                 _(u"milliweber"):
1919                         [(m,1.0e-3),"mWb",''],
1920                 _(u"microweber"):
1921                         [(m,1.0e-6),u"\xb5Wb",''],
1922                 _(u"unit pole (electro magnetic unit)"):
1923                         [(m,4e-8*pi),'',''],
1924                 _(u"maxwell"):
1925                         [(m,1.0e-8),"Mx",_(u"Named after the Scottish physicist James Clerk Maxwell (1831-1879). A cgs unit of magnetic flux equal to the flux perpendicular to an area of 1 square centimeter in a magnetic field of 1 gauss.")],
1926                 _(u"line of force"):
1927                         [(m,1.0e-8),'',_(u"Same as Maxwell")],
1928         },
1929         _(u"Magnetic Field strength"):{".base_unit":"ampere per meter",
1930                 _(u"oersted"):
1931                         [(m,1.0e3/(4*pi)),"Oe",_(u"Named after the Danish physicist and chemist Hans Christian Oersted (1777-1851). The C.G.S. unit of magnetic reluctance or resistance, equal to the reluctance of a centimeter cube of air (or vacuum) between parallel faces. Also, a reluctance in which unit magnetomotive force sets up unit flux.")],
1932                 _(u"ampere per meter"):
1933                         [(m,1.0),"A/m",''],
1934                 _(u"ampere-turn per meter"):
1935                         [(m,1.0),"A/m",''],
1936                 _(u"kiloampere per meter"):
1937                         [(m,1.0e3),"kA/m",''],
1938                 _(u"ampere-turn per inch"):
1939                         [(m,39.3700787401575),"At/in",''],
1940                 _(u"newton per weber"):
1941                         [(m,1.0),"N/Wb",_(u"Same as ampere per meter")],
1942         },
1943         _(u"Magnetic Flux Density"):{".base_unit":"tesla",
1944                 _(u"tesla"):
1945                         [(m,1.0),"T",_(u"Named after the Croatian born inventer Nikola Tesla (1856-1943). A unit of magnetic flux density equal to one weber per square meter.")],
1946                 _(u"millitesla"):
1947                         [(m,1.0e-3),"mT",''],
1948                 _(u"microtesla"):
1949                         [(m,1.0e-6),u"\xb5T",''],
1950                 _(u"nanotesla"):
1951                         [(m,1.0e-9),"nT",''],
1952                 _(u"weber per square meter"):
1953                         [(m,1.0),u"Wb/m\xb2",''],
1954                 _(u"kilogauss"):
1955                         [(m,1.0e-1),"kG",''],
1956                 _(u"gauss"):
1957                         [(m,1.0e-4),"G",_(u"Named after German mathematician and astronomer Karl Friedrich Gauss (1777-1855). The C.G.S. unit of density of magnetic field, equal to a field of one line of force per square centimeter, being thus adopted as an international unit at Paris in 1900; sometimes used as a unit of intensity of magnetic field. It was previously suggested as a unit of magnetomotive force.")],
1958                 _(u"maxwell per square centimeter"):
1959                         [(m,1.0e-4),u"Mx/cm\xb2",''],
1960                 _(u"maxwell per square inch"):
1961                         [(m,1.5500031000062E-05),u"Mx/in\xb2",''],
1962                 _(u"line per square inch"):
1963                         [(m,1.5500031000062E-05),'',_(u"Same as Maxwell per square inch.")],
1964                 _(u"gamma"):
1965                         [(m,1.0e-9),'',_(u"one nanotesla.")],
1966         },
1967         _(u"Mass"):{".base_unit":"kilogram",
1968                 _(u"talanton"):
1969                         [(m,149.9985),'',_(u"Greek measure.")],
1970                 _(u"oka (Egyptian)"):
1971                         [(m,1.248),'',''],
1972                 _(u"oka (Greek)"):
1973                         [(m,1.2799),'',''],
1974                 _(u"okia"):
1975                         [(m,0.03744027),'',_(u"Egyptian measure.")],
1976                 _(u"kat"):
1977                         [(m,0.009331),'',_(u"Egyptian measure.")],
1978                 _(u"kerat"):
1979                         [(m,0.00019504),'',_(u"Egyptian measure.")],
1980                 _(u"pala"):
1981                         [(m,0.047173),'',_(u"Indian measure.")],
1982                 _(u"kona"):
1983                         [(m,0.00699828),'',_(u"Indian measure.")],
1984                 _(u"mast"):
1985                         [(m,.9331),'',_(u"British")],
1986                 _(u"kilogram"):
1987                         [(m,1.0),"kg",_(u"A measure of weight, being a thousand grams, equal to 2.2046 pounds avoirdupois (15,432.34 grains). It is equal to the weight of a cubic decimeter of distilled water at the temperature of maximum density, or 39deg Fahrenheit.")],
1988                 _(u"megagram"):
1989                         [(m,1.0e3),"Mg",''],
1990                 _(u"gram"):
1991                         [(m,1.0e-3),"g",_(u"The unit of weight in the metric system. It was intended to be exactly, and is very nearly, equivalent to the weight in a vacuum of one cubic centimeter of pure water at its maximum density. It is equal to 15.432 grains.")],
1992                 _(u"milligram"):
1993                         [(m,1.0e-6),"mg",_(u"A measure of weight, in the metric system, being the thousandth part of a gram, equal to the weight of a cubic millimeter of water, or .01543 of a grain avoirdupois.")],
1994                 _(u"microgram"):
1995                         [(m,1.0e-9),u"\xb5g",_(u"A measure of weight, in the metric system, being the millionth part of a gram.")],
1996                 _(u"ton (UK | long | gross | deadweight)"):
1997                         [(m,2240 * 0.45359237),'',_(u"A British unit of weight equivalent to 2240 pounds")],
1998                 _(u"ton (US | short)"):
1999                         [(m,2000 * 0.45359237),"tn",_(u"A US unit of weight equivalent to 2000 pounds")],
2000                 _(u"tonne | metric ton"):
2001                         [(m,1.0e3),"t",_(u"A metric ton, One Megagram. 1000 kg")],
2002                 _(u"pound (avoirdupois)"):
2003                         [(m,0.45359237),"lb",_(u"The pound in general use in the United States and in England is the pound avoirdupois, which is divided into sixteen ounces, and contains 7,000 grains. The pound troy is divided into twelve ounces, and contains 5,760 grains. 144 pounds avoirdupois are equal to 175 pounds troy weight")],
2004                 _(u"pound (troy)"):
2005                         [(m,0.3732417216),'',''],
2006                 _(u"hundredweight (short | net | US)"):
2007                         [(m,100*0.45359237),"cwt",_(u"A denomination of weight of 100 pounds. In most of the United States, both in practice and by law, it is 100 pounds avoirdupois.")],
2008                 _(u"hundredweight (long | English)"):
2009                         [(m,112*0.45359237),"cwt",_(u"A denomination of weight of 112 pounds")],
2010                 _(u"slug"):
2011                         [(m,14.5939029372064),'',_(u"One slug is the mass accelerated at 1 foot per second per second by a force of 1 pound.")],
2012                 _(u"ounce (troy)"):
2013                         [(m,0.0311034768),"ozt",_(u"A unit of apothecary weight equal to 480 grains.")],
2014                 _(u"ounce (avoirdupois)"):
2015                         [(m,0.45359237/16),"oz",_(u"A weight, the sixteenth part of a pound avoirdupois")],
2016                 _(u"dram (avoirdupois)"):
2017                         [(m,(0.45359237/16)/16),'',_(u"A weight; in Avoirdupois weight, one sixteenth part of an ounce.")],
2018                 _(u"dram (troy | apothecary)"):
2019                         [(m,(0.0311034768)/8),'',_(u"""A weight; in Apothecaries' weight, one eighth part of an ounce, or sixty grains.""")],
2020                 _(u"scruple (troy)"):
2021                         [(m,20*(0.45359237/5760)),'',_(u"A weight of twenty grains; the third part of a troy dram.")],
2022                 _(u"carat"):
2023                         [(m,0.0002),'',_(u"The weight by which precious stones and pearls are weighed.")],
2024                 _(u"grain"):
2025                         [(m,0.00006479891),"gr",_(u"The unit of the English system of weights; -- so called because considered equal to the average of grains taken from the middle of the ears of wheat. 7,000 grains constitute the pound avoirdupois and 5,760 grains constitute the pound troy.")],
2026                 _(u"amu (atomic mass unit) | dalton"):
2027                         [(m,1.66044E-27),"amu",_(u"Unit of mass for expressing masses of atoms or molecules.")],
2028                 _(u"catty | caddy | chin"):
2029                         [(m,(4.0/3)*0.45359237),'',_(u"An Chinese or East Indian Weight of 1 1/3 pounds.")],
2030                 _(u"cental"):
2031                         [(m,100*0.45359237),'',_(u"British for 100 pounds. Also called hundredweight in the US.")],
2032                 _(u"cotton bale (US)"):
2033                         [(m,500*0.45359237),'',_(u"US measurement. 500 pounds")],
2034                 _(u"cotton bale (Egypt)"):
2035                         [(m,750*0.45359237),'',_(u"Egyptian measurement. 750 pounds")],
2036                 _(u"crith"):
2037                         [(m,0.0000906),'',_(u"From the Greek word for barleycorn. The weight of a liter of hydrogen at 0.01\xb0 centigrade and with a and pressure of 1 atmosphere.")],
2038                 _(u"denarius"):
2039                         [(m,60*(0.45359237/5760)),'',_(u"Roman weight measuring 60 troy grains")],
2040                 _(u"dinar"):
2041                         [(m,4.2e-3),'',_(u"Arabian weight measuring 4.2 gram")],
2042                 _(u"doppelzentner"):
2043                         [(m,100.0),'',_(u"Metric hundredweight = 100 kg")],
2044                 _(u"drachma (Greek)"):
2045                         [(m,0.0042923),'',_(u"The weight of an old Greek drachma coin")],
2046                 _(u"drachma (Dutch)"):
2047                         [(m,3.906e-3),'',_(u"The weight of an old Dutch drachma coin")],
2048                 _(u"earth mass"):
2049                         [(m,5.983E+24),'',_(u"Mass of the Earth.")],
2050                 _(u"electron rest mass"):
2051                         [(m,9.109558E-31),'',_(u"The mass of an electron as measured when the it is at rest relative to an observer, an inherent property of the body.")],
2052                 _(u"funt"):
2053                         [(m,0.408233133),'',_(u"Russian, 0.9 pounds")],
2054                 _(u"obolos (Ancient Greece)"):
2055                         [(m,0.0042923/6),'',_(u"Ancient Greek weight of an obol coin, 1/6 drachma")],
2056                 _(u"obolos (Modern Greece)"):
2057                         [(m,1.0e-4),'',_(u"Modern Greek name for decigram.")],
2058                 _(u"hyl"):
2059                         [(m,0.00980665),'',_(u"From an ancient Greek word for matter. One hyl is the mass that is accelerated at one meter per second per second by one kilogram of force. 0.00980665 kg.")],
2060
2061                 _(u"pennyweight (troy)"):
2062                         [(m,24*0.00006479891),'',_(u"A troy weight containing twenty-four grains, or the twentieth part of a troy ounce; as, a pennyweight of gold or of arsenic. It was anciently the weight of a silver penny.")],
2063                 _(u"bekah (Biblical)"):
2064                         [(m,5*24*0.00006479891),'',_(u"1/2 shekel, 5 pennyweight.")],
2065                 _(u"shekel (Israeli)"):
2066                         [(m,10*24*0.00006479891),'',_(u"The sixtieth part of a mina. Ten pennyweight. An ancient weight and coin used by the Jews and by other nations of the same stock.")],
2067                 _(u"mina (Greek) | minah (Biblical)"):
2068                         [(m,60*10*24*0.00006479891),'',_(u"The weight of the ancient Greek mina coin. 60 shekels")],
2069                 _(u"talent (Roman)"):
2070                         [(m,125*0.3265865064),'',_(u"125 Roman libra.")],
2071                 _(u"talent (silver)"):
2072                         [(m,3000*10*24*0.00006479891),'',_(u"3,000 shekels or 125 lbs.")],
2073                 _(u"talent (gold)"):
2074                         [(m,6000*10*24*0.00006479891),'',_(u"2 silver talents, 250 lbs.")],
2075                 _(u"talent (Hebrew)"):
2076                         [(m,26.332),'',''],
2077
2078                 _(u"kin"):
2079                         [(m,0.60010270551),'',_(u"Japanese kin,  1.323 pound.")],
2080                 _(u"kwan"):
2081                         [(m,3.7512088999),'',_(u"Japanese kwan. 8.27 pound")],
2082                 _(u"liang | tael"):
2083                         [(m,((4.0/3)*0.45359237)/16),'',_(u"Chinese. 1/16 catty")],
2084                 _(u"libra | librae | as | pondus"):
2085                         [(m,0.3265865064),'',_(u"Roman originator of the English pound (lb). 12 uncia")],
2086                 _(u"libra (Mexican)"):
2087                         [(m,0.46039625555),'',''],
2088                 _(u"libra (Spanish)"):
2089                         [(m,0.45994266318),'',''],
2090                 _(u"livre (French)"):
2091                         [(m,0.49),'',''],
2092                 _(u"quarter (long)"):
2093                         [(m,(112*0.45359237)/4),'',_(u"The fourth part of a long hundredweight. 28 pounds")],
2094                 _(u"quarter (short)"):
2095                         [(m,(100*0.45359237)/4),'',_(u"The fourth part of a short hundredweight. 25 pounds")],
2096                 _(u"mite (English)"):
2097                         [(m,0.0000032399455),'',_(u"A small weight; one twentieth of a grain.")],
2098                 _(u"neutron rest mass"):
2099                         [(m,1.67492E-27),'',_(u"The mass of a neutron as measured when the it is at rest relative to an observer, an inherent property of the body.")],
2100                 _(u"proton rest mass"):
2101                         [(m,1.672614E-27),'',_(u"The mass of a proton as measured when the it is at rest relative to an observer, an inherent property of the body.")],
2102                 _(u"pfund (German)"):
2103                         [(m,0.5),'',_(u"German pound. 500 grams. 16 unze.")],
2104                 _(u"unze (German)"):
2105                         [(m,0.5/16),'',_(u"German ounce. 1/16 pfund.")],
2106                 _(u"lot (German)"):
2107                         [(m,0.5/32),'',_(u"One half unze.")],
2108                 _(u"picul | tan | pecul | pecal (Chinese | Summatra))"):
2109                         [(m,133.5*0.45359237),'',_(u"100 catty. 133 1/2 pounds")],
2110                 _(u"picul (Japan)"):
2111                         [(m,(400.0/3)*0.45359237),'',_(u"133 1/3 pounds")],
2112                 _(u"picul (Borneo)"):
2113                         [(m,(1085.0/8)*0.45359237),'',_(u"135 5/8 pounds")],
2114                 _(u"pood (Russian)"):
2115                         [(m,16.3792204807),'',_(u"A Russian weight, equal to forty Russian pounds or about thirty-six English pounds avoirdupois.")],
2116                 _(u"quintal"):
2117                         [(m,100.0),'',_(u"A metric measure of weight, being 100,000 grams, or 100 kilograms")],
2118                 _(u"quintal (short UK)"):
2119                         [(m,100*0.45359237),'',_(u"100 pounds")],
2120                 _(u"quintal (long UK)"):
2121                         [(m,112*0.45359237),'',_(u"112 pounds")],
2122                 _(u"quintal (Spanish)"):
2123                         [(m,45.994266318),'',_(u"Spanish hundredweight")],
2124                 _(u"scrupulum (Roman)"):
2125                         [(m,0.0011359248923),'',''],
2126                 _(u"stone (legal)"):
2127                         [(m,14*0.45359237),'',_(u"14 pounds")],
2128                 _(u"stone (butchers)"):
2129                         [(m,8*0.45359237),'',_(u"Meat or fish. 8 pounds")],
2130                 _(u"stone (cheese)"):
2131                         [(m,16*0.45359237),'',_(u"16 pounds.")],
2132                 _(u"stone (hemp)"):
2133                         [(m,32*0.45359237),'',_(u"32 pounds")],
2134                 _(u"stone (glass)"):
2135                         [(m,5*0.45359237),'',_(u"5 pounds")],
2136                 _(u"uncia"):
2137                         [(m,0.3265865064/12),'',_('Ancient Roman. A twelfth part, as of the Roman "as" or "libra"; an ounce. 420 grains')],
2138         },
2139         _(u"Musical notes"):{".base_unit":"breve",
2140                 _(u"whole note | semibreve"):
2141                         [(m,0.5),'',_(u"A note of half the time or duration of the breve; -- now usually called a whole note.")],
2142                 _(u"breve"):
2143                         [(m,1.0),'',_(u"A note or character of time, equivalent to two semibreves or four minims. When dotted, it is equal to three semibreves.")],
2144                 _(u"minim"):
2145                         [(m,0.25),'',_(u"A time note, a half note, equal to half a semibreve, or two quarter notes or crotchets.")],
2146                 _(u"crotchet"):
2147                         [(m,0.125),'',_(u"A time note, with a stem, having one fourth the value of a semibreve, one half that of a minim, and twice that of a quaver; a quarter note.")],
2148                 _(u"quaver"):
2149                         [(m,0.0625),'',_(u"An eighth note.")],
2150         },
2151         _(u"Power"):{".base_unit":"watt",
2152                 _(u"megawatt"):
2153                         [(m,1.0e6),"MW",''],
2154                 _(u"kilowatt"):
2155                         [(m,1.0e3),"kW",''],
2156                 _(u"watt"):
2157                         [(m,1.0),"W",_(u"Named after the Scottish engineer and inventor James Watt (1736-1819). A unit of power or activity equal to 10^7 C.G.S. units of power, or to work done at the rate of one joule a second.")],
2158                 _(u"milliwatt"):
2159                         [(m,1.0e-3),"mW",''],
2160                 _(u"microwatt"):
2161                         [(m,1.0e-6),"uW",''],
2162
2163                 _(u"horsepower (boiler)"):
2164                         [(m,9.81e3),'',_(u"A unit of power representing the power exerted by a horse in pulling.")],
2165                 _(u"horsepower"):
2166                         [(m,746.0),"hp",''],
2167                 _(u"ton of refrigeration"):
2168                         [(m,10.0/3*1055.05585262),"TR",''],
2169                 _(u"btu per second"):
2170                         [(m,1055.05585262),"Btu/s",''],
2171                 _(u"calorie per second"):
2172                         [(m,4.1868),"cal/s",''],
2173                 _(u"kilcalorie per hour"):
2174                         [(m,4186.8/3600),"kcal/h",_(u"Useful for calculating heating facilities and kitchens.")],
2175                 _(u"frig per hour"):
2176                         [(m,4186.8/3600),"frig/h",_(u"The same as kcal/h, but used for air conditioning and refrigerating.")],
2177                 _(u"foot pound force per second"):
2178                         [(m,1.356),"lbf/s",''],
2179                 _(u"joule per second"):
2180                         [(m,1.0),"J/s",''],
2181                 _(u"newton meter per second"):
2182                         [(m,1.0),u"N\xb7m/s",''],
2183                 _(u"btu per hour"):
2184                         [(m,0.293071070172222),"Btu/h",''],
2185                 _(u"foot pound force per minute"):
2186                         [(m,0.0226),u"ft\xb7lbf/min",''],
2187                 _(u"erg per second"):
2188                         [(m,1.0e-7),"erg/s",''],
2189                 _(u"dyne centimeter per second"):
2190                         [(m,1.0e-7),'',''],
2191                 _(u"lusec"):
2192                         [(m,0.000133322368421),'',_(u"Used to measure the leakage of vacuum pumps. A flow of one liter per second at a pressure of one micrometer of mercury.")],
2193         },
2194         _(u"Pressure and Stress"):{".base_unit":"pascal",
2195                 _(u"pascal"):
2196                         [(m,1.0),"Pa",_(u"Named after the French philosopher and mathematician Blaise Pascal (1623 - 1662). Equal to one newton per square meter.")],
2197                 _(u"hectopascal"):
2198                         [(m,100),"hPa",''],
2199                 _(u"kilopascal"):
2200                         [(m,1.0e3),"kPa",''],
2201                 _(u"megapascal"):
2202                         [(m,1.0e6),"MPa",''],
2203                 _(u"atmosphere (absolute,standard)"):
2204                         [(m,101325),"atm",_(u"The average pressure of the Earth's atmosphere at sea level.")],
2205                 _(u"atmosphere (technical)"):
2206                         [(m,98066.5),"atm",_(u"A metric unit equal to one kilogram of force per square centimeter.")],
2207                 _(u"bar"):
2208                         [(m,1.0e5),"bar",_(u"From the Greek word baros.")],
2209                 _(u"pound force per square inch"):
2210                         [(m,6894.75729316836),"psi",''],
2211                 _(u"ounces per square inch"):
2212                         [(m,6894.75729316836/16),u"oz/in\xb2",''],
2213                 _(u"feet of water (60F,15.5C)"):
2214                         [(m,12*133.322*1.866),"ftH20",''],
2215                 _(u"inches of water (60F,15.5C)"):
2216                         [(m,133.322*1.866),"inH20",''],
2217                 _(u"meter of water (60F,15.5C)"):
2218                         [(m,133.322*1.866/.0254),"mH20",''],
2219                 _(u"centimeter of water (60F,15.5C)"):
2220                         [(m,133.322*1.866/2.54),"cmH20",''],
2221                 _(u"millimeter of water (60F,15.5C)"):
2222                         [(m,133.322*1.866/25.4),"mmH20",''],
2223
2224                 _(u"feet of water (39.2F,4C)"):
2225                         [(m,2988.9921933),"ftH20",''],
2226                 _(u"inches of water (39.2F,4C)"):
2227                         [(m,249.0826828),"inH20",''],
2228                 _(u"meter of water (39.2F,4C)"):
2229                         [(m,9806.4048337),"mH20",''],
2230                 _(u"centimeter of water (39.2F,4C)"):
2231                         [(m,98.0640483),"cmH20",''],
2232                 _(u"millimeter of water (39.2F,4C)"):
2233                         [(m,9.80640483),"mmH20",''],
2234
2235                 _(u"inches of mercury (60F,15.5C)"):
2236                         [(m,3337.0),"inHg",''],
2237                 _(u"millimeter of mercury (0C)"):
2238                         [(m,133.322368421),"mmHg",''],
2239                 _(u"inches of mercury (0C)"):
2240                         [(m,133.322368421*25.4),"inHg",''],
2241                 _(u"micrometer of mercury (0C)"):
2242                         [(m,0.133322368421),u"\xb5mHg",''],
2243                 _(u"centimeter of mercury (0C)"):
2244                         [(m,1333.22368421),"cmHg",''],
2245                 _(u"foot of mercury (0C)"):
2246                         [(m,1333.22368421*25.4),"ftHg",''],
2247                 _(u"torricelli"):
2248                         [(m,133.322368421),"torr",_(u"Named after Italian physicist and mathematician Evangelista Torricelli, (1608-1647). A unit of pressure equal to 0.001316 atmosphere.")],
2249                 _(u"micron"):
2250                         [(m,133.322368421/1000),u"\xb5",_(u"Used in vacuum technology. Equal to 1 millitorr.")],
2251                 _(u"millibar"):
2252                         [(m,1.0e2),"mbar",''],
2253                 _(u"pound force per square foot"):
2254                         [(m,47.8802589803358),u"lbf/ft\xb2",''],
2255                 _(u"tons (UK) per square foot"):
2256                         [(m,47.8802589803358*2240),u"tons(UK)/ft\xb2",''],
2257                 _(u"tons (US) per square foot"):
2258                         [(m,47.8802589803358*2000),u"tons(US)/ft\xb2",''],
2259                 _(u"kilogram force per square meter"):
2260                         [(m,9.80665),u"kgf/m\xb2",''],
2261                 _(u"kilogram force per square centimeter"):
2262                         [(m,9.80665e4),u"kgf/cm\xb2",_(u"Used for ground pressure and steel stress.")],
2263                 _(u"newton per square meter"):
2264                         [(m,1.0),u"N/m\xb2",''],
2265                 _(u"newton per square centimeter"):
2266                         [(m,1.0e4),u"N/cm\xb2",''],
2267                 _(u"newton per square millimeter"):
2268                         [(m,1.0e6),u"N/mm\xb2",_(u"Used for concrete stress.")],
2269                 _(u"kiloNewton per square meter"):
2270                         [(m,1.0e3),u"kN/m\xb2",_(u"Used for ground pressure.")],
2271                 _(u"kiloNewton per square centimeter"):
2272                         [(m,1.0e7),u"kN/cm\xb2",_(u"Used for loads and concrete stress.")],
2273                 _(u"microbar"):
2274                         [(m,1.0e-1),u"\xb5bar",''],
2275                 _(u"dyne per square centimeter"):
2276                         [(m,1.0e-1),u"dyn/cm\xb2",''],
2277                 _(u"barie | barye"):
2278                         [(m,0.1),'',''],
2279                 _(u"pieze"):
2280                         [(m,1.0e3),'',_(u"From the Greek word piezein (to press). The pieze is a pressure of one sthene per square meter. 1000 newtons per square meter.")],
2281         },
2282         _(u"Prefixes and Suffixes"):{".base_unit":"one | mono",
2283                 _(u"centillion (US)"):
2284                         [(m,1.0e303),'',_(u"10^303. Note: British word centillion means 10^600 (too big for this program to represent as floating point).")],
2285                 _(u"novemtrigintillion (US) | vigintillion (UK)"):
2286                         [(m,1.0e120),'',_(u"10^120. ")],
2287                 _(u"octotrigintillion (US)"):
2288                         [(m,1.0e117),'',_(u"10^117. ")],
2289                 _(u"septentrigintillion (US) | novemdecillion (UK)"):
2290                         [(m,1.0e114),'',_(u"10^114. ")],
2291                 _(u"sextrigintillion (US)"):
2292                         [(m,1.0e111),'',_(u"10^111. ")],
2293                 _(u"quintrigintillion (US) | octodecillion (UK)"):
2294                         [(m,1.0e108),'',_(u"10^108. ")],
2295                 _(u"quattuortrigintillion (US)"):
2296                         [(m,1.0e105),'',_(u"10^105. ")],
2297                 _(u"tretrigintillion (US) | septendecillion (UK)"):
2298                         [(m,1.0e102),'',_(u"10^102. ")],
2299                 _(u"googol"):
2300                         [(m,1.0e100),'',_(u"10^100 Ten dotrigintillion (US). Note: a googolplex is 10^10^10^2.")],
2301                 _(u"dotrigintillion (US)"):
2302                         [(m,1.0e99),'',_(u"10^99. ")],
2303                 _(u"untrigintillion (US) | sexdecillion (UK)"):
2304                         [(m,1.0e96),'',_(u"10^96. ")],
2305                 _(u"trigintillion (US)"):
2306                         [(m,1.0e93),'',_(u"10^93. ")],
2307                 _(u"novemvigintillion (US) | quindecillion (UK)"):
2308                         [(m,1.0e90),'',_(u"10^90. ")],
2309                 _(u"octovigintillion (US)"):
2310                         [(m,1.0e87),'',_(u"10^87. ")],
2311                 _(u"septenvigintillion (US) | quattuordecillion (UK)"):
2312                         [(m,1.0e84),'',_(u"10^84. ")],
2313                 _(u"sexvigintillion (US)"):
2314                         [(m,1.0e81),'',_(u"10^81. ")],
2315                 _(u"quinvigintillion (US) | tredecillion (UK)"):
2316                         [(m,1.0e78),'',_(u"10^78. ")],
2317                 _(u"quattuorvigintillion (US)"):
2318                         [(m,1.0e75),'',_(u"10^75. ")],
2319                 _(u"trevigintillion (US) | duodecillion (UK)"):
2320                         [(m,1.0e72),'',_(u"10^72. ")],
2321                 _(u"dovigintillion (US)"):
2322                         [(m,1.0e69),'',_(u"10^69. ")],
2323                 _(u"unvigintillion (US) | undecillion (UK"):
2324                         [(m,1.0e66),'',_(u"10^66. ")],
2325                 _(u"vigintillion (US)"):
2326                         [(m,1.0e63),'',_(u"10^63. ")],
2327                 _(u"novemdecillion (US) | decillion (UK)"):
2328                         [(m,1.0e60),'',_(u"10^60. ")],
2329                 _(u"octodecillion (US)"):
2330                         [(m,1.0e57),'',_(u"10^57. ")],
2331                 _(u"septendecillion (US) | nonillion (UK)"):
2332                         [(m,1.0e54),'',_(u"10^54. ")],
2333                 _(u"sexdecillion (US)"):
2334                         [(m,1.0e51),'',_(u"10^51. ")],
2335                 _(u"quindecillion (US) | octillion (UK)"):
2336                         [(m,1.0e48),'',_(u"10^48. ")],
2337                 _(u"quattuordecillion (US)"):
2338                         [(m,1.0e45),'',_(u"10^45. ")],
2339                 _(u"tredecillion (US) | septillion (UK)"):
2340                         [(m,1.0e42),'',_(u"10^42. ")],
2341                 _(u"duodecillion (US) | chici"):
2342                         [(m,1.0e39),"Ch",_(u"10^39. chici coined by Morgan Burke after Marx brother Chico Marx.")],
2343                 _(u"undecillion (US) | sextillion (UK) | gummi"):
2344                         [(m,1.0e36),"Gm",_(u"10^36. gummi coined by Morgan Burke after Marx brother Gummo Marx.")],
2345                 _(u"una | decillion (US) | zeppi"):
2346                         [(m,1.0e33),"Zp",_(u"10^33. zeppi coined by Morgan Burke after Marx brother Zeppo Marx.")],
2347                 _(u"dea | nonillion (US) | quintillion (UK) | grouchi"):
2348                         [(m,1.0e30),"Gc",_(u"10^30. grouchi coined by Morgan Burke after Marx brother Groucho Marx.")],
2349                 _(u"nea | octillion (US) | quadrilliard (UK) | harpi"):
2350                         [(m,1.0e27),"Hr",_(u"10^27. harpi coined by Morgan Burke after Marx brother Harpo Marx.")],
2351                 _(u"yotta | septillion (US) | quadrillion (UK)"):
2352                         [(m,1.0e24),"Y",'10^24. Origin Latin penultimate letter y "iota".'],
2353                 _(u"zetta | sextillion (US) | trilliard (UK)"):
2354                         [(m,1.0e21),"Z",'10^21. Origin Latin ultimate letter z "zeta".'],
2355                 _(u"exa | quintillion (US) | trillion (UK)"):
2356                         [(m,1.0e18),"E",'10^18. Origin Greek for outside "exo" / Greek six hexa" as in 1000^6.'],
2357                 _(u"peta | quadrillion (US) | billiard (UK)"):
2358                         [(m,1.0e15),"P",'10^15. Origin Greek for spread "petalos" / Greek five "penta" as in 1000^5. Note: British use the words "1000 billion".'],
2359                 _(u"tera | trillion (US) | billion (UK)"):
2360                         [(m,1.0e12),"T",'10^12. Origin Greek for monster "teras" / Greek four "tetra" as in 1000^4. Note: British use the word billion.'],
2361                 _(u"giga"):
2362                         [(m,1.0e9),"G",'10^9. Origin Greek for giant "gigas".'],
2363                 _(u"billion (US) | milliard (UK)"):
2364                         [(m,1.0e9),'','10^9.'],
2365                 _(u"mega | million"):
2366                         [(m,1.0e6),"M",'10^6. One million times. Origin Greek for large, great "megas".'],
2367                 _(u"hectokilo"):
2368                         [(m,1.0e5),"hk",_(u"10^5. 100 thousand times")],
2369                 _(u"myra | myria"):
2370                         [(m,1.0e4),"ma",_(u"Ten thousand times, 10^4")],
2371                 _(u"kilo | thousand"):
2372                         [(m,1.0e3),"k",'One thousand times, 10^3.Origin Greek for thousand "chylioi".'],
2373                 _(u"gross"):
2374                         [(m,144.0),'',_(u"Twelve dozen.")],
2375                 _(u"hecto | hundred"):
2376                         [(m,1.0e2),'','One hundred times, 10^2.Origin Greek for hundred "hekaton".'],
2377                 _(u"vic"):
2378                         [(m,20.0),'',_(u"Twenty times.")],
2379                 _(u"duodec"):
2380                         [(m,12.0),'',_(u"Twelve times.")],
2381                 _(u"dozen (bakers | long)"):
2382                         [(m,13.0),'',_(u"Thirteen items. The cardinal number that is the sum of twelve and one syn:  thirteen, 13, XIII, long dozen.")],
2383                 _(u"dozen"):
2384                         [(m,12.0),'',_(u"Twelve items. Usually used to measure the quantity of eggs in a carton.")],
2385                 _(u"undec"):
2386                         [(m,11.0),'',_(u"Eleven times.")],
2387                 _(u"deca | deka | ten"):
2388                         [(m,1.0e1),'','10^1. Ten times. Origin Greek for ten "deka".'],
2389                 _(u"sex | hexad"):
2390                         [(m,6.0),'',_(u"Six times.")],
2391                 _(u"quin"):
2392                         [(m,5.0),'',_(u"Five times.")],
2393                 _(u"quadr | quadri | quadruple"):
2394                         [(m,4.0),'',_(u"Four times.")],
2395                 _(u"thrice | tri | triple"):
2396                         [(m,3.0),'',_(u"Three times.")],
2397                 _(u"bi | double"):
2398                         [(m,2.0),'',_(u"Two times.")],
2399                 _(u"sesqui | sesqu"):
2400                         [(m,1.5),'',_(u"One and one half times.")],
2401                 _(u"one | mono"):
2402                         [(m,1.0),'',_(u"Single unit value.")],
2403                 _(u"quarter"):
2404                         [(m,0.25),'',_(u"One fourth.")],
2405                 _(u"demi | semi | half"):
2406                         [(m,0.5),'',_(u"One half.")],
2407                 _(u"eigth"):
2408                         [(m,0.125),'',_(u"One eigth.")],
2409                 _(u"deci"):
2410                         [(m,1.0e-1),"d",'10^-1. Origin Latin tenth "decimus".'],
2411                 _(u"centi"):
2412                         [(m,1.0e-2),"c",'10^-2. Origin Latin hundred, hundredth "centum".'],
2413                 _(u"percent"):
2414                         [(m,1.0e-2),"%",_(u"10^-2. A proportion multiplied by 100")],
2415                 _(u"milli"):
2416                         [(m,1.0e-3),"m",'10^-3. A prefix denoting a thousandth part of; as, millimeter, milligram, milliampere.Origin Latin thousand "mille".'],
2417                 _(u"decimilli"):
2418                         [(m,1.0e-4),"dm",_(u"10^-4")],
2419                 _(u"centimilli"):
2420                         [(m,1.0e-5),"cm",_(u"10^-5. ")],
2421                 _(u"micro"):
2422                         [(m,1.0e-6),u"\xb5",'10^-6. A millionth part of; as, microfarad, microohm, micrometer.Origin Latin small "mikros".'],
2423                 _(u"parts per million | ppm"):
2424                         [(m,1.0e-6),"ppm",_(u"10^-6. Parts per million usually used in measuring chemical concentrations.")],
2425                 _(u"nano"):
2426                         [(m,1.0e-9),"n",'10^-9. Origin Greek dwarf "nanos".'],
2427                 _(u"pico"):
2428                         [(m,1.0e-12),"p",'10^-12. Origin Italian tiny "piccolo".'],
2429                 _(u"femto"):
2430                         [(m,1.0e-15),"f",'10^-15. Origin Old Norse fifteen "femten" as in 10^-15.'],
2431                 _(u"atto"):
2432                         [(m,1.0e-18),"a",'10^-18. Origin Old Norse eighteen "atten" as in 10^-18.'],
2433                 _(u"zepto | ento"):
2434                         [(m,1.0e-21),"z",'10^-21. zepto origin Latin ultimate letter z "zeta".'],
2435                 _(u"yocto | fito"):
2436                         [(m,1.0e-24),"y",'10^-24. yocto origin Latin penultimate letter y "iota".'],
2437                 _(u"syto | harpo"):
2438                         [(m,1.0e-27),"hr",_(u"10^-27. harpo coined by Morgan Burke after Marx brother Harpo Marx.")],
2439                 _(u"tredo | groucho"):
2440                         [(m,1.0e-30),"gc",_(u"10^-30. groucho coined by Morgan Burke after Marx brother Groucho Marx.")],
2441                 _(u"revo | zeppo"):
2442                         [(m,1.0e-33),"zp",_(u"10^-33. zeppo coined by Morgan Burke after Marx brother Zeppo Marx.")],
2443                 _(u"gummo"):
2444                         [(m,1.0e-36),"gm",_(u"10^-36. Coined by Morgan Burke after Marx brother Gummo Marx.")],
2445                 _(u"chico"):
2446                         [(m,1.0e-39),"ch",_(u"10^-39. Coined by Morgan Burke after Marx brother Chico Marx.")],
2447         },
2448         #There does not seem to be a "standard" for shoe sizes so some are left out for now until a decent reference can be found.
2449         _(u"Shoe Size"):{".base_unit":"centimeter",
2450                 _(u"centimeter"):
2451                         [(m,1.0),"cm",_(u"The hundredth part of a meter; a measure of length equal to rather more than thirty-nine hundredths (0.3937) of an inch.")],
2452                 _(u"inch"):
2453                         [(m,(2.54)),"in",_(u"The twelfth part of a foot, commonly subdivided into halves, quarters, eights, sixteenths, etc., as among mechanics. It was also formerly divided into twelve parts, called lines, and originally into three parts, called barleycorns, its length supposed to have been determined from three grains of barley placed end to end lengthwise.")],
2454                 #"European"):
2455                 #       [(slo,((35,47),(22.5,30.5))),'',_(u"Used by Birkenstock")],
2456                 _(u"Mens (US)"):
2457                         [(slo,((6.0,13.0),((2.54*(9+1.0/3)),(2.54*(11+2.0/3))))),'','Starting at 9 1/3" for size 6 and moving up by 1/6" for each half size to 11 2/3" for size 13. Beware that some manufacturers use different measurement techniques.'],
2458                 _(u"Womens (US)"):
2459                         [(gof,(2.54*((2.0+2.0/6)/7.0),2.54*(8.5-(5.0*((2.0+2.0/6)/7.0))))),'','Starting at 8 1/2" for size 5 and moving up by 1/6" for each half size to 10 5/6" for size 12. Beware that some manufacturers use different measurement techniques.'],
2460                 _(u"Childrens (US)"):
2461                         [(dso,((5.5,13.5),((2.54*(4.0+5.0/6)),(2.54*7.5)),(1.0,5.0),(2.54*(7.0+2.0/3),2.54*9.0))),'','Starting at 4 5/6" for size 5 1/2 up to 7 1/3" for size 13 then 7 2/3" for size 1 and going up to 9" for size 5.'],
2462                 _(u"Mens (UK)"):
2463                         [(slo,((5.0,12.0),((2.54*(9+1.0/3)),(2.54*(11+2.0/3))))),'','Starting at 9 1/3" for size 5 and moving up by 1/6" for each half size to 11 2/3" for size 12. Beware that some manufacturers use different measurement techniques.'],
2464                 _(u"Womens (UK)"):
2465                         [(gof,(2.54*((2.0+2.0/6)/7.0),2.54*(8.5-(3.0*((2.0+2.0/6)/7.0))))),'','Starting at 8 1/2" for size 3 and moving up by 1/6" for each half size to 10 5/6" for size 10. Beware that some manufacturers use different measurement techniques.'],
2466                 #"Asian"):
2467                 #       [(slo,((23.5,31.5),(25.0,30.5))),'',''],
2468         },
2469         _(u"Speed | Velocity"):{".base_unit":"meter per second",
2470                 _(u"meter per second"):
2471                         [(m,1.0),"m/s",''],
2472                 _(u"speed of light | warp"):
2473                         [(m,299792458.0),"c",_(u"The speed at which light travels in a vacuum; about 300,000 km per second; a universal constant.")],
2474                 _(u"miles per second"):
2475                         [(m,1609.344),"mi/s",''],
2476                 _(u"kilometer per second"):
2477                         [(m,1.0e3),"km/s",''],
2478                 _(u"millimeter per second"):
2479                         [(m,1.0e-3),"mm/s",''],
2480                 _(u"knot"):
2481                         [(m,0.514444444444444),'',_(u"Nautical measurement for speed as one nautical mile per hour. The number of knots which run off from the reel in half a minute, therefore, shows the number of miles the vessel sails in an hour.")],
2482                 _(u"miles per hour"):
2483                         [(m,0.44704),"mi/h",''],
2484                 _(u"foot per second"):
2485                         [(m,0.3048),"ft/s",''],
2486                 _(u"foot per minute"):
2487                         [(m,0.00508),"ft/min",''],
2488                 _(u"kilometer per hour"):
2489                         [(m,0.277777777777778),"km/h",''],
2490                 _(u"mile per day"):
2491                         [(m,1.86266666666667E-02),"mi/day",''],
2492                 _(u"centimeter per second"):
2493                         [(m,1.0e-2),"cm/s",''],
2494                 _(u"knot (admiralty)"):
2495                         [(m,0.514773333333333),'',''],
2496                 _(u"mach (sea level & 32 degF)"):
2497                         [(m,331.46),'',''],
2498         },
2499         _(u"Temperature"):{".base_unit":_(u"kelvin"),
2500                 _(u"kelvin"):
2501                         [(m,1.0),"K",_(u"Named after the English mathematician and physicist William Thomson Kelvin (1824-1907). The basic unit of thermodynamic temperature adopted under the System International d'Unites.")],
2502                 _(u"celsius (absolute)"):
2503                         [(m,1.0),u"\xb0C absolute",''],
2504                 _(u"celsius (formerly centigrade)"):
2505                         [(ofg,(273.15,1.0)),u"\xb0C",_(u"Named after the Swedish astronomer and physicist Anders Celsius (1701-1744). The Celsius thermometer or scale. It is the same as the centigrade thermometer or scale. 0\xb0 marks the freezing point of water and 100\xb0 marks the boiling point of water.  ")],
2506                 _(u"fahrenheit"):
2507                         [(f,('((x-32.0)/1.8)+273.15','((x-273.15)*1.8)+32.0')),u"\xb0F",_(u"Named after the German physicist Gabriel Daniel Fahrenheit (1686-1736). The Fahrenheit thermometer is so graduated that the freezing point of water is at 32\xb0 above the zero of its scale, and the boiling point at 212\xb0 above. It is commonly used in the United States and in England.")],
2508
2509                 _(u"reaumur"):
2510                         [(gof,(1.25,273.15)),u"\xb0Re",_(u"Named after the French scientist Ren\u00E9-Antoine Ferchault de R\u00E9aumur (1683-1757). Conformed to the scale adopted by R\u00E9aumur in graduating the thermometer he invented. The R\u00E9aumur thermometer is so graduated that 0\xb0 marks the freezing point and 80\xb0 the boiling point of water.")],
2511                 _(u"fahrenheit (absolute)"):
2512                         [(m,1/1.8),u"\xb0F absolute",''],
2513                 _(u"rankine"):
2514                         [(m,1/1.8),u"\xb0R",_(u"Named after the British physicist and engineer William Rankine (1820-1872). An absolute temperature scale in Fahrenheit degrees.")],
2515         },
2516
2517         _(u"Temperature Difference"):{".base_unit":"temp. diff. in kelvin",
2518                 _(u"temp. diff. in kelvin"):
2519                         [(m,1.0),"K",''],
2520                 _(u"temp. diff. in degrees Celsius"):
2521                         [(m,1.0),u"\xb0C",''],
2522                 _(u"temp. diff. in degrees Reaumur"):
2523                         [(m,1.25),u"\xb0Re",''],
2524                 _(u"temp. diff. in degrees Rankine"):
2525                         [(m,5.0/9),u"\xb0R",''],
2526                 _(u"temp. diff. in degrees Fahrenheit"):
2527                         [(m,5.0/9),u"\xb0F",''],
2528         },
2529         _(u"Time"):{".base_unit":"second",
2530                 _(u"year"):
2531                         [(m,365*86400.0),"a",_(u"The time of the apparent revolution of the sun trough the ecliptic; the period occupied by the earth in making its revolution around the sun, called the astronomical year; also, a period more or less nearly agreeing with this, adopted by various nations as a measure of time, and called the civil year; as, the common lunar year of 354 days, still in use among the Mohammedans; the year of 360 days, etc. In common usage, the year consists of 365 days, and every fourth year (called bissextile, or leap year) of 366 days, a day being added to February on that year, on account of the excess above 365 days")],
2532                 _(u"year (anomalistic)"):
2533                         [(m,365*86400.0+22428.0),'',_(u"The time of the earth's revolution from perihelion to perihelion again, which is 365 days, 6 hours, 13 minutes, and 48 seconds.")],
2534                 _(u"year (common lunar)"):
2535                         [(m,354*86400.0),'',_(u"The period of 12 lunar months, or 354 days.")],
2536                 _(u"year (embolismic | Intercalary lunar)"):
2537                         [(m,384*86400.0),'',_(u"The period of 13 lunar months, or 384 days.")],
2538                 _(u"year (leap | bissextile)"):
2539                         [(m,366*86400.0),'',_(u"Bissextile; a year containing 366 days; every fourth year which leaps over a day more than a common year, giving to February twenty-nine days. Note: Every year whose number is divisible by four without a remainder is a leap year, excepting the full centuries, which, to be leap years, must be divisible by 400 without a remainder. If not so divisible they are common years. 1900, therefore, is not a leap year.")],
2540                 _(u"year (sabbatical)"):
2541                         [(m,7*365*86400.0),'',_(u"Every seventh year, in which the Israelites were commanded to suffer their fields and vineyards to rest, or lie without tillage.")],
2542                 _(u"year (lunar astronomical)"):
2543                         [(m,354*86400.0+31716.0),'',_(u"The period of 12 lunar synodical months, or 354 days, 8 hours, 48 minutes, 36 seconds.")],
2544                 _(u"year (lunisolar)"):
2545                         [(m,532*365*86400.0),'',_(u"A period of time, at the end of which, in the Julian calendar, the new and full moons and the eclipses recur on the same days of the week and month and year as in the previous period. It consists of 532 common years, being the least common multiple of the numbers of years in the cycle of the sun and the cycle of the moon.")],
2546                 _(u"year (sidereal)"):
2547                         [(m,365*86400.0+22149.3),'',_(u"The time in which the sun, departing from any fixed star, returns to the same. This is 365 days, 6 hours, 9 minutes, and 9.3 seconds.")],
2548                 _(u"year (sothic)"):
2549                         [(m,365*86400.0+6*3600.0),'',_(u"The Egyptian year of 365 days and 6 hours, as distinguished from the Egyptian vague year, which contained 365 days. The Sothic period consists of 1,460 Sothic years, being equal to 1,461 vague years. One of these periods ended in July, a.d. 139.")],
2550                 _(u"year (tropic)"):
2551                         [(m,365*86400.0+20926.0),'',_(u"The solar year; the period occupied by the sun in passing from one tropic or one equinox to the same again, having a mean length of 365 days, 5 hours, 48 minutes, 46.0 seconds, which is 20 minutes, 23.3 seconds shorter than the sidereal year, on account of the precession of the equinoxes.")],
2552                 _(u"month"):
2553                         [(m,365*86400.0/12),'',_(u"One of the twelve portions into which the year is divided; the twelfth part of a year, corresponding nearly to the length of a synodic revolution of the moon, -- whence the name. In popular use, a period of four weeks is often called a month.")],
2554                 _(u"month (sidereal)"):
2555                         [(m,27.322*86400.0),'',_(u"Period between successive conjunctions with a star, 27.322 days")],
2556                 _(u"month (synodic | lunar month | lunation)"):
2557                         [(m,29.53059*86400.0),'',_(u"The period between successive new moons (29.53059 days) syn: lunar month, moon, lunation")],
2558                 _(u"day"):
2559                         [(m,86400.0),"d",_(u"The period of the earth's revolution on its axis. -- ordinarily divided into twenty-four hours. It is measured by the interval between two successive transits of a celestial body over the same meridian, and takes a specific name from that of the body. Thus, if this is the sun, the day (the interval between two successive transits of the sun's center over the same meridian) is called a solar day; if it is a star, a sidereal day; if it is the moon, a lunar day.")],
2560                 _(u"day (sidereal)"):
2561                         [(m,86164.09),'',_(u"The interval between two successive transits of the first point of Aries over the same meridian. The Sidereal day is 23 h. 56 m. 4.09 s. of mean solar time.")],
2562                 _(u"day (lunar | tidal)"):
2563                         [(m,86400.0+50*60.0),'',_(u"24 hours 50 minutes used in tidal predictions. ")],
2564                 _(u"hour"):
2565                         [(m,3600.0),"h",_(u"The twenty-fourth part of a day; sixty minutes.")],
2566                 _(u"minute"):
2567                         [(m,60.0),"min",_(u"The sixtieth part of an hour; sixty seconds.")],
2568                 _(u"second"):
2569                         [(m,1.0),"s",_(u"The sixtieth part of a minute of time.")],
2570                 _(u"millisecond"):
2571                         [(m,1.0e-3),"ms",_(u"One thousandth of a second.")],
2572                 _(u"microsecond"):
2573                         [(m,1.0e-6),u"\xb5s",_(u"One millionth of a second.")],
2574                 _(u"nanosecond"):
2575                         [(m,1.0e-9),"ns",''],
2576                 _(u"picosecond"):
2577                         [(m,1.0e-12),"ps",''],
2578                 _(u"millennium"):
2579                         [(m,1000*365*86400.0),'',_(u"A thousand years; especially, the thousand years mentioned in the twentieth chapter in the twentieth chapter of Revelation, during which holiness is to be triumphant throughout the world. Some believe that, during this period, Christ will reign on earth in person with his saints.")],
2580                 _(u"century"):
2581                         [(m,100*365*86400.0),'',_(u"A period of a hundred years; as, this event took place over two centuries ago. Note: Century, in the reckoning of time, although often used in a general way of any series of hundred consecutive years (as, a century of temperance work), usually signifies a division of the Christian era, consisting of a period of one hundred years ending with the hundredth year from which it is named; as, the first century (a. d. 1-100 inclusive); the seventh century (a.d. 601-700); the eighteenth century (a.d. 1701-1800). With words or phrases connecting it with some other system of chronology it is used of similar division of those eras; as, the first century of Rome (A.U.C. 1-100).")],
2582                 _(u"decade"):
2583                         [(m,10*365*86400.0),'',_(u"A group or division of ten; esp., a period of ten years; a decennium; as, a decade of years or days; a decade of soldiers; the second decade of Livy.")],
2584                 _(u"week"):
2585                         [(m,7*86400.0),'',_(u"A period of seven days, usually that reckoned from one Sabbath or Sunday to the next. Also seven nights, known as sennight.")],
2586                 _(u"fortnight"):
2587                         [(m,14*86400.0),'',_(u"Fourteen nights, our ancestors reckoning time by nights and winters.  The space of fourteen days; two weeks.")],
2588                 _(u"novennial"):
2589                         [(m,9*365*86400.0),'',_(u"Done or recurring every ninth year.")],
2590                 _(u"octennial"):
2591                         [(m,8*365*86400.0),'',_(u"Happening every eighth year; also, lasting a period of eight years.")],
2592                 _(u"olympiad"):
2593                         [(m,4*365*86400.0),'',_(u"A period of four years, by which the ancient Greeks reckoned time, being the interval from one celebration of the Olympic games to another, beginning with the victory of Coroebus in the foot race, which took place in the year 776 b.c.; as, the era of the olympiads.")],
2594                 _(u"pregnancy"):
2595                         [(m,9*365*86400.0/12),'',_(u"The condition of being pregnant; the state of being with young. A period of approximately 9 months for humans")],
2596                 _(u"quindecennial"):
2597                         [(m,15*365*86400.0),'',_(u"A period of 15 years.")],
2598                 _(u"quinquennial"):
2599                         [(m,5*365*86400.0),'',_(u"Occurring once in five years, or at the end of every five years; also, lasting five years. A quinquennial event.")],
2600                 _(u"septennial"):
2601                         [(m,7*365*86400.0),'',_(u"Lasting or continuing seven years; as, septennial parliaments.")],
2602                 _(u"cesium vibrations"):
2603                         [(m,1.0/9192631770.0),"vibrations",_(u"It takes one second for hot cesium atoms to vibrate 9,192,631,770 times (microwaves). This standard was adopted by the International System in 1967.")],
2604         },
2605         _(u"Viscosity (Dynamic)"):{".base_unit":"pascal-second",
2606                 _(u"pascal-second"):
2607                         [(m,1.0),u"Pa\xb7s",''],
2608                 _(u"reyn"):
2609                         [(m,6894.75729316836),'',''],
2610                 _(u"poise"):
2611                         [(m,0.1),"P",''],
2612                 _(u"microreyn"):
2613                         [(m,6894.75729316836e-6),'',''],
2614                 _(u"millipascal-second"):
2615                         [(m,1.0e-3),u"mPa\xb7s",''],
2616                 _(u"centipoise"):
2617                         [(m,1.0e-3),"cP",''],
2618                 _(u"micropascal-second"):
2619                         [(m,1.0e-6),u"\xb5Pa\xb7s",''],
2620         },
2621         _(u"Viscosity (Kinematic)"):{".base_unit":"square meter per second",
2622                 _(u"square meter per second"):
2623                         [(m,1.0),u"m\xb2/s",''],
2624                 _(u"square millimeter per second"):
2625                         [(m,1.0e-6),u"mm\xb2/s",''],
2626                 _(u"square foot per second"):
2627                         [(m,0.09290304),u"ft\xb2/s",''],
2628                 _(u"square centimetre per second"):
2629                         [(m,1.0e-4),u"cm\xb2/s",''],
2630                 _(u"stokes"):
2631                         [(m,1.0e-4),"St",''],
2632                 _(u"centistokes"):
2633                         [(m,1.0e-6),"cSt",''],
2634         },
2635         _(u"Volume and Liquid Capacity"):{".base_unit":"millilitre",
2636                 _(u"can #10 can"):
2637                         [(m,4*2*2*8*2*3*4.92892159375/128*109.43),'',_(u"Taken from the Can Manufacturers Institute (CMI).  http://www.cancentral.com/standard.cfm#foodcan")],
2638                 _(u"can #2 can"):
2639                         [(m,4*2*2*8*2*3*4.92892159375/128*20.55),'',_(u"Taken from the Can Manufacturers Institute (CMI).  http://www.cancentral.com/standard.cfm#foodcan")],
2640                 _(u"can #2.5 can"):
2641                         [(m,4*2*2*8*2*3*4.92892159375/128*29.79),'',_(u"Taken from the Can Manufacturers Institute (CMI).  http://www.cancentral.com/standard.cfm#foodcan")],
2642                 _(u"can #5 can"):
2643                         [(m,4*2*2*8*2*3*4.92892159375/128*59.1),'',_(u"Taken from the Can Manufacturers Institute (CMI).  http://www.cancentral.com/standard.cfm#foodcan")],
2644                 _(u"can #1 can (Picnic)"):
2645                         [(m,4*2*2*8*2*3*4.92892159375/128*10.94),'',_(u"Taken from the Can Manufacturers Institute (CMI).  http://www.cancentral.com/standard.cfm#foodcan")],
2646                 _(u"can #1 can (Tall)"):
2647                         [(m,4*2*2*8*2*3*4.92892159375/128* 16.70),'',_(u"Taken from the Can Manufacturers Institute (CMI).  http://www.cancentral.com/standard.cfm#foodcan")],
2648                 _(u"can #303 can"):
2649                         [(m,4*2*2*8*2*3*4.92892159375/128* 16.88),'',_(u"Taken from the Can Manufacturers Institute (CMI) http://www.cancentral.com/standard.cfm#foodcan .")],
2650                 _(u"barrel (wine UK)"):
2651                         [(m,31.5*4*2*2.5*8*2*3*4.73551071041125),'',_(u"31.5 UK Gallons")],
2652                 _(u"barrel (UK)"):
2653                         [(m,36*4*2*2.5*8*2*3*4.73551071041125),'',_(u"36 UK Gallons")],
2654                 _(u"barrel of oil (US)"):
2655                         [(m,42*4*2*2*8*2*3*4.92892159375),"",_(u"Barrel of petroleum (oil), 42 US Gallons")],
2656                 _(u"barrel (US federal)"):
2657                         [(m,31*4*2*2*8*2*3*4.92892159375),"",_(u"31 US Gallons")],
2658                 _(u"barrel (US)"):
2659                         [(m,31.5*4*2*2*8*2*3*4.92892159375),"",_(u"31.5 US Gallons")],
2660                 _(u"caphite"):
2661                         [(m,1374.1046),'',_(u"Ancient Arabian")],
2662                 _(u"cantaro"):
2663                         [(m,13521.1108),'',_(u"Spanish")],
2664                 _(u"oxybaphon"):
2665                         [(m,66.245),'',_(u"Greek")],
2666                 _(u"cotula | hemina | kotyle"):
2667                         [(m,308.3505),'',_(u"Greek")],
2668                 _(u"cyathos"):
2669                         [(m,451.5132),'',_(u"Greek")],
2670                 _(u"cados"):
2671                         [(m,38043.3566),'',_(u"Greek")],
2672                 _(u"metertes | amphura"):
2673                         [(m,39001.092),'',_(u"Greek")],
2674                 _(u"mushti"):
2675                         [(m,60.9653),'',_(u"Indian")],
2676                 _(u"cab"):
2677                         [(m,2202.5036),'',_(u"Israeli")],
2678                 _(u"hekat"):
2679                         [(m,4768.6752),'',_(u"Israeli")],
2680                 _(u"bath | bu"):
2681                         [(m,36871.2),'',_(u"Israeli")],
2682                 _(u"acetabulum"):
2683                         [(m,66.0752),'',_('Roman')],
2684
2685                 _(u"dash (UK)"):
2686                         [(m,4.73551071041125/16),'',_(u"one half of a pinch")],
2687                 _(u"pinch (UK)"):
2688                         [(m,4.73551071041125/8),'',_(u"One eigth of a teaspoon")],
2689                 _(u"gallon (UK)"):
2690                         [(m,4*2*2.5*8*2*3*4.73551071041125),'',_(u"A measure of capacity, containing four quarts; -- used, for the most part, in liquid measure, but sometimes in dry measure. The English imperial gallon contains 10 pounds avoirdupois of distilled water at 62\xb0F, and barometer at 30 inches, equal to 277.274 cubic inches.")],
2691                 _(u"quart (UK)"):
2692                         [(m,2*2.5*8*2*3*4.73551071041125),'',_(u"The fourth part of a gallon; the eighth part of a peck; two pints. Note: In imperial measure, a quart is forty English fluid ounces; in wine measure, it is thirty-two American fluid ounces. The United States dry quart contains 67.20 cubic inches, the fluid quart 57.75. The English quart contains 69.32 cubic inches.")],
2693                 _(u"pint (UK)"):
2694                         [(m,2.5*8*2*3*4.73551071041125),'',''],
2695                 _(u"cup (UK)"):
2696                         [(m,8*2*3*4.73551071041125),'',''],
2697                 _(u"ounce - fluid ounce (UK)"):
2698                         [(m,2*3*4.73551071041125),'',_(u"Contains 1 ounce mass of distilled water at 62\xb0F, and barometer at 30 inches")],
2699                 _(u"tablespoon (UK)"):
2700                         [(m,3*4.73551071041125),'',_(u"One sixteenth of a cup. A spoon of the largest size commonly used at the table; -- distinguished from teaspoon, dessert spoon, etc.")],
2701                 _(u"teaspoon (UK)"):
2702                         [(m,4.73551071041125),'',_(u"One third of a tablespoon. A small spoon used in stirring and sipping tea, coffee, etc., and for other purposes.")],
2703
2704                 _(u"dash (US)"):
2705                         [(m,4.92892159375/16),'',_(u"one half of a pinch")],
2706                 _(u"pinch (US)"):
2707                         [(m,4.92892159375/8),'',_(u"One eigth of a teaspoon")],
2708                 _(u"keg (beer US)"):
2709                         [(m,15.5*768*4.92892159375),"","""US standard size beer keg = 1/2 barrel = 15.5 US gallons; weighs approx. 29.7 pounds empty, 160.5 pounds full."""],
2710                 _(u"keg (wine US)"):
2711                         [(m,12*768*4.92892159375),"","""12 US gallons."""],
2712                 _(u"ponykeg (US)"):
2713                         [(m,7.75*768*4.92892159375),"","""1/2 US beerkeg, 7.75 US gallons."""],
2714                 _(u"barrel (beer US)"):
2715                         [(m,31*768*4.92892159375),"","""Two US beerkegs, 31 US gallons."""],
2716                 _(u"barrel (wine US)"):
2717                         [(m,31.5*768*4.92892159375),"","""31.5 US gallons."""],
2718                 _(u"hogshead (US)"):
2719                         [(m,63*768*4.92892159375),"","""Equal to 2 barrels or 63 US gallons."""],       
2720                 _(u"fifth (US)"):
2721                         [(m,.2*768*4.92892159375),"","""One fifth of a gallon."""],
2722                 _(u"jigger"):
2723                         [(m,9*4.92892159375),"","""1.5 fluid ounces (US)"""],
2724                 _(u"shot"):
2725                         [(m,9*4.92892159375),"","""1.5 fluid ounces (US)"""],
2726                 _(u"winebottle"):
2727                         [(m,750*1.0),"","""750 milliliters"""],
2728                 _(u"wineglass (US)"):
2729                         [(m,24*4.92892159375),"","""Equal to 4 fluid ounces (US)."""],
2730                 _(u"winesplit"):
2731                         [(m,750.0/4),"","""1/4 winebottle"""],
2732                 _(u"magnum"):
2733                         [(m,1500),"","""1.5 liters"""],
2734                 _(u"gallon (US)"):
2735                         [(m,4*2*2*8*2*3*4.92892159375),'',_(u"A measure of capacity, containing four quarts; -- used, for the most part, in liquid measure, but sometimes in dry measure. Note: The standard gallon of the Unites States contains 231 cubic inches, or 8.3389 pounds avoirdupois of distilled water at its maximum density, and with the barometer at 30 inches. This is almost exactly equivalent to a cylinder of seven inches in diameter and six inches in height, and is the same as the old English wine gallon. The beer gallon, now little used in the United States, contains 282 cubic inches.")],
2736                 _(u"quart (US)"):
2737                         [(m,2*2*8*2*3*4.92892159375),'',_(u"The fourth part of a gallon; the eighth part of a peck; two pints. Note: In imperial measure, a quart is forty English fluid ounces; in wine measure, it is thirty-two American fluid ounces. The United States dry quart contains 67.20 cubic inches, the fluid quart 57.75. The English quart contains 69.32 cubic inches.")],
2738                 _(u"pint (US)"):
2739                         [(m,2*8*2*3*4.92892159375),'',''],
2740                 _(u"cup (US)"):
2741                         [(m,8*2*3*4.92892159375),'',''],
2742                 _(u"ounce - fluid ounce (US)"):
2743                         [(m,2*3*4.92892159375),'',''],
2744                 _(u"beerbottle (US 12 ounce)"):
2745                         [(m,12*2*3*4.92892159375),'',''],
2746                 _(u"tablespoon (US)"):
2747                         [(m,3*4.92892159375),'',_(u"One sixteenth of a cup. A spoon of the largest size commonly used at the table; -- distinguished from teaspoon, dessert spoon, etc.")],
2748                 _(u"teaspoon (US)"):
2749                         [(m,4.92892159375),'',_(u"One third of a tablespoon. A small spoon used in stirring and sipping tea, coffee, etc., and for other purposes.")],
2750
2751                 _(u"shaku"):
2752                         [(m,18.04),'',_(u"A Japanese unit of volume, the shaku equals about 18.04 milliliters (0.61 U.S. fluid ounce). Note: shaku also means area and length.")],
2753
2754                 _(u"cubic yard"):
2755                         [(m,27*1728*16.387064),u"yd\xb3",''],
2756                 _(u"acre foot"):
2757                         [(m,1728*16.387064*43560),'',''],
2758                 _(u"cubic foot"):
2759                         [(m,1728*16.387064),u"ft\xb3",''],
2760                 _(u"cubic inch"):
2761                         [(m,16.387064),u"in\xb3",''],
2762
2763                 _(u"cubic meter"):
2764                         [(m,1.0e6),u"m\xb3",''],
2765                 _(u"cubic decimeter"):
2766                         [(m,1.0e3),u"dm\xb3",''],
2767                 _(u"litre"):
2768                         [(m,1.0e3),"l",_(u"A measure of capacity in the metric system, being a cubic decimeter.")],
2769                 _(u"cubic centimeter"):
2770                         [(m,1.0),u"cm\xb3",''],
2771                 _(u"millilitre"):
2772                         [(m,1.0),"ml",''],
2773                 _(u"centilitre"):
2774                         [(m,10*1.0),"cl",''],
2775                 _(u"decilitre"):
2776                         [(m,10*10*1.0),"dl",''],
2777                 _(u"mil"):
2778                         [(m,1.0),'',_(u"Equal to one thousandth of a liter syn: milliliter, millilitre, ml, cubic centimeter, cubic centimeter, cc")],
2779                 _(u"minim"):
2780                         [(m,2*3*4.92892159375/480),'',_(u"Used in Pharmaceutical to represent one drop. 1/60 fluid dram or 1/480 fluid ounce. A U.S. minim is about 0.003760 in\xb3 or 61.610 \xb5l. The British minim is about 0.003612 in\xb3 or 59.194 \xb5l. Origin of the word is from the Latin minimus, or small.")],
2781         },
2782         _(u"Volume and Dry Capacity"):{".base_unit":"cubic meter",
2783                 _(u"cubic meter"):
2784                         [(m,1.0),u"m\xb3",''],
2785                 _(u"cubic decimeter"):
2786                         [(m,1.0e-3),u"dm\xb3",''],
2787                 _(u"cubic millimeter"):
2788                         [(m,1.0e-9),u"mm\xb3",""""""],
2789                 _(u"cubic centimeter"):
2790                         [(m,1.0e-6),u"cm\xb3",""""""],
2791                 _(u"cord"):
2792                         [(m,3.624556363776),'',_(u"A pile of wood 8ft x 4ft x 4ft.")],
2793                 _(u"cubic yard"):
2794                         [(m,0.764554857984),u"yd\xb3",''],
2795                 _(u"bushel (US)"):
2796                         [(m,4*2*0.00440488377086),"bu",_(u"A dry measure, containing four pecks, eight gallons, or thirty-two quarts. Note: The Winchester bushel, formerly used in England, contained 2150.42 cubic inches, being the volume of a cylinder 181/2 inches in internal diameter and eight inches in depth. The standard bushel measures, prepared by the United States Government and distributed to the States, hold each 77.6274 pounds of distilled water, at 39.8deg Fahr. and 30 inches atmospheric pressure, being the equivalent of the Winchester bushel. The imperial bushel now in use in England is larger than the Winchester bushel, containing 2218.2 cubic inches, or 80 pounds of water at 62deg Fahr.")],
2797                 _(u"bushel (UK | CAN)"):
2798                         [(m,4*2*4*1.1365225e-3),"bu",_(u"A dry measure, containing four pecks, eight gallons, or thirty-two quarts. Note: The Winchester bushel, formerly used in England, contained 2150.42 cubic inches, being the volume of a cylinder 181/2 inches in internal diameter and eight inches in depth. The standard bushel measures, prepared by the United States Government and distributed to the States, hold each 77.6274 pounds of distilled water, at 39.8deg Fahr. and 30 inches atmospheric pressure, being the equivalent of the Winchester bushel. The imperial bushel now in use in England is larger than the Winchester bushel, containing 2218.2 cubic inches, or 80 pounds of water at 62deg Fahr.")],
2799                 _(u"peck (US)"):
2800                         [(m,2*0.00440488377086),'',''],
2801                 _(u"peck (UK | CAN)"):
2802                         [(m,2*4*1.1365225e-3),'',''],
2803                 _(u"gallon (US dry)"):
2804                         [(m,0.00440488377086),"gal",''],
2805                 _(u"gallon (CAN)"):
2806                         [(m,4*1.1365225e-3),"gal",''],
2807                 _(u"quart (US dry)"):
2808                         [(m,1.101220942715e-3),"qt",''],
2809                 _(u"quart (CAN)"):
2810                         [(m,1.1365225e-3),"qt",''],
2811                 _(u"cubic foot"):
2812                         [(m,0.028316846592),u"ft\xb3",''],
2813                 _(u"board foot"):
2814                         [(m,0.028316846592/12),'',_(u"lumber 1ft\xb2 and 1 in thick")],
2815                 _(u"litre"):
2816                         [(m,1.0e-3),"l",_(u"A measure of capacity in the metric system, being a cubic decimeter.")],
2817                 _(u"pint (US dry)"):
2818                         [(m,5.506104713575E-04),"pt",''],
2819                 _(u"cubic inch"):
2820                         [(m,0.000016387064),u"in\xb3",''],
2821                 _(u"coomb"):
2822                         [(m,4*4*2*4*1.1365225e-3),'',_(u"British. 4 bushels")],
2823                 _(u"peck"):
2824                         [(m,37.23670995671),'',_(u"The fourth part of a bushel; a dry measure of eight quarts")],
2825                 _(u"quart (dry)"):
2826                         [(m,4.65458874458874),'',_(u"The fourth part of a gallon; the eighth part of a peck; two pints. Note: In imperial measure, a quart is forty English fluid ounces; in wine measure, it is thirty-two American fluid ounces. The United States dry quart contains 67.20 cubic inches, the fluid quart 57.75. The English quart contains 69.32 cubic inches.")],
2827         },
2828         _(u"Thermal conductance (Area)"):{".base_unit":"Watts per square meter Kelvin",
2829                 _(u"watts per square meter Kelvin"):
2830                         [(m,1.0),u"W/m\xb2\xb7K",''],
2831                 _(u"watts per square meter deg C"):
2832                         [(m,1.0),u"W/h.m\xb2\xb7\xb0C",''],
2833                 _(u"kilocalories per hour square meter deg C"):
2834                         [(m,1.163),u"kcal/h\xb7m\xb7\xb0C",''],
2835                 _(u"british thermal units per second square foot deg F"):
2836                         [(m,2.0428),u"Btu/sec\xb7ft\xb2\xb7\xb0F",''],
2837                 _(u"british thermal units per hour square foot deg F"):
2838                         [(m,5.6782),u"Btu/h\xb7ft\xb2\xb7\xb0F",''],
2839         },
2840         _(u"Thermal conductance (Linear)"):{".base_unit":"cubic meter",
2841                 _(u"watts per meter Kelvin"):
2842                         [(m,1.0),u"W/m\xb7K",''],
2843                 _(u"watts per meter deg C"):
2844                         [(m,1.0),u"W/m\xb7\xb0C",''],
2845                 _(u"kilocalories per hour meter deg C"):
2846                         [(m,1.163),u"kcal/h\xb7m\xb7\xb0C",''],
2847                 _(u"british thermal units per second foot deg F"):
2848                         [(m,1.703),u"Btu/sec\xb7ft\xb7\xb0F",''],
2849         },
2850         _(u"Thermal resistance"):{".base_unit":_(u"square meter kelvin per watt"),
2851                 _(u"square meter kelvin per watt"):
2852                         [(m,1.0),u"m\xb2\xb7K/W",''],
2853                 _(u"square meter deg C per watt"):
2854                         [(m,1.0),u"m\xb2\xb7\xb0C/W",''],
2855                 _(u"clo"):
2856                         [(m,1.50e-1),u"clo",_(u"Clo is the unit for effective clothing insulation. It is used to evaluate the expected comfort of users in certain humidity, temperature and workload conditions (and estimate air conditioning or heating loads, for instance.).")],
2857                 _(u"hour square foot deg F per BTU"):
2858                         [(m,1.761e-1),u"h\xb7ft\xb2\xb7\xb0F/Btu",''],
2859                 _(u"hour square meter deg C per kilocalorie"):
2860                         [(m,8.62e-1),u"h\xb7m\xb2\xb7\xb0C/kcal",''],
2861         },
2862         _(u"Specific Heat"):{".base_unit":"joule per kilogram kelvin",
2863                 _(u"joule per kilogram kelvin"):
2864                         [(m,1.0),u"J/kg\xb7K",''],
2865                 _(u"joule per kilogram deg C"):
2866                         [(m,1.0),u"J/kg\xb7\xb0C",''],
2867                 _(u"kilocalories per kilogram deg C"):
2868                         [(m,4.18855e3),u"kcal/kg\xb7\xb0C",''],
2869                 _(u"btu per pound deg F"):
2870                         [(m,4.1868e3),u"BTU/lb\xb7\xb0F",''],
2871         },
2872         _(u"Fuel consumption"):{".base_unit":"miles per gallon (US)",
2873                 _(u"miles per gallon (US)"):
2874                         [(m,1.0),u"mpg (US)",''],
2875                 _(u"gallons  (US) per 100 miles"):
2876                         [(inv,100.0),u'',''],
2877                 _(u"miles per gallon (Imperial)"):
2878                         [(m,1.0/1.20095),u"mpg (Imperial)",''],
2879                 _(u"gallons (Imperial) per 100 miles"):
2880                         [(inv,100.0/1.20095),u'',''],
2881                 _(u"liters per 100 kilometer"):
2882                         [(inv,62.1371192237/0.264172052358),u'',''],
2883                 _(u"kilometers per liter"):
2884                         [(m,.621371192237/0.264172052358),u'',''],
2885         },
2886         _(u"Torque"):{".base_unit":"newton meter",
2887                 _(u"newton meter"):
2888                         [(m,1.0),u"N\xb7m",_(u"The SI unit of force that causes rotation.")],
2889                 _(u"joules"):
2890                         [(m,1.0),u"j",''],
2891                 _(u"kilo newton meter"):
2892                         [(m,1000.0),u"kN\xb7m",''],
2893                 _(u"mega newton meter"):
2894                         [(m,1000000.0),u"MN\xb7m",''],
2895                 _(u"milli newton meter"):
2896                         [(m,1.0e-3),u"mN\xb7m",''],
2897                 _(u"micro newton meter"):
2898                         [(m,1.0e-6),u"\xb5N\xb7m",''],
2899                 _(u"dyne centimeter"):
2900                         [(m,1.0e-7),u"dyne\xb7cm",''],
2901                 _(u"kilogram meter"):
2902                         [(m,9.80665),u"kg\xb7m",''],
2903                 _(u"centimeter gram"):
2904                         [(m,9.80665/100000.0),u"cm\xb7g",''],
2905                 _(u"kip"):
2906                         [(m,113.0),u"kip",_(u"One thousand inch pounds.")],
2907                 _(u"foot pounds"):
2908                         [(m,1356.0/1000.0),u"lbf\xb7ft",''],
2909                 _(u"foot ounce"):
2910                         [(m,1356.0/1000.0/16.0),u"oz\xb7ft",''],
2911                 _(u"meter kilopond"):
2912                         [(m,9.80665),u"mkp",''],
2913                 _(u"newton centimeter"):
2914                         [(m,.01),u"N\xb7cm",''],
2915                 _(u"inch ounces"):
2916                         [(m,113.0/16.0*.001),u"in\xb7oz",''],
2917                 _(u"inch pounds"):
2918                         [(m,113.0*.001),u"in\xb7lb",''],
2919                 _(u"foot poundal"):
2920                         [(m,1.0/23.7303605),u'',''],
2921         },
2922         _(u"Current Loop"):{".base_unit":"6400 to 32000",
2923                 _(u"6400 to 32000"):
2924                         [(m,1.0),u"counts",_(u"Many PLCs must scale the 4 to 20mA signal to an integer, this is commonly a value from 6400 to 32000,")],
2925                 _(u"4 to 20mA"):
2926                         [(m,1600.0),u"mA",_(u"This range of current is commonly used in instrumentation. 0mA is an indication of a broken transmitter loop.")],
2927                 _(u"V across 250 ohm"):
2928                         [(m,6400.0),u"V",_(u"A common resistance for current loop instrumentation is 250 ohms. A voltage will be developed across this resistor, that voltage can be used to test the current loop.")],
2929                 _(u"percent"):
2930                         [(gof,(((32000.0-6400.0)/100.0),6400.0)),u"%",_(u"This is a percentage of the 4 to 20mA signal.")],
2931         },
2932
2933         _(u"Currency (UK)"):{".base_unit":"pound",
2934                 _(u"pound | quid | soverign"):
2935                         [(m,1.0),"","""The base monetary unit in UK."""],
2936                 _(u"soverign"):
2937                         [(m,1.0),"","""One pound."""],
2938                 _(u"quid"):
2939                         [(m,1.0),"","""One pound."""],
2940                 _(u"fiver"):
2941                         [(m,5*1.0),"","""Equal to five pounds."""],
2942                 _(u"tenner"):
2943                         [(m,10*1.0),"","""Equal to Ten pounds."""],
2944                 _(u"crown"):
2945                         [(m,5*1.0/20),"","""Equal to five shillings."""],
2946                 _(u"shilling"):
2947                         [(m,1.0/20),"","""Equal to one twentieth of a pound."""],
2948                 _(u"bob | shilling"):
2949                         [(m,1.0/20),"","""Equal to one twentieth of a pound."""],
2950                 _(u"penny | pence"):
2951                         [(m,1.0/100),"","""Equal to 1/100 of a pound."""],
2952                 _(u"penny | pence (old)"):
2953                         [(m,1.0/240),"","""Equal to 1/240 of a pound.  February 15, 1971 the English coinage system was changed to a decimal system and the old penny ceased to be legal tender August 31, 1971."""],
2954                 _(u"tuppence(old)"):
2955                         [(m,2*1.0/240),"","""Equal to two old pennies. February 15, 1971 the English coinage system was changed to a decimal system."""],
2956                 _(u"threepence (old)"):
2957                         [(m,3*1.0/240),"","""Equal to three old pence.  The threepence was demonitized August 31, 1971."""],
2958                 _(u"halfpenny | hapenny (old)"):
2959                         [(m,1.0/240/2),"","""The old halfpenny was demonetized on August 31, 1969."""],
2960                 _(u"guinea"):
2961                         [(m,21*1.0/20),"","""While the term is still used, the coins are no longer in use.  Webster's Revised Unabridged Dictionary (1913) - A gold coin of England current for twenty-one shillings sterling, ... but not coined since the issue of sovereigns in 1817."""],
2962                 _(u"farthing"):
2963                         [(m,1.0/240/4),"",""""""],
2964                 _(u"florin (or two bob bit)"):
2965                         [(m,2*1.0/20),"",""""""],
2966                 _(u"half crown (old)"):
2967                         [(m,(2*1.0/20)+(6*1.0/240)),"",""" The half-crown was demonetized on 1st January 1970."""],
2968                 _(u"sixpence"):
2969                         [(m,6*1.0/240),"","""Equal to six old pence.  February 15, 1971 the English coinage system was changed to a decimal system ."""],
2970                 _(u"tanner | sixpence"):
2971                         [(m,6*1.0/240),"","""Equal to six old pence.  February 15, 1971 the English coinage system was changed to a decimal system ."""],
2972                 _(u"mark (old British mark)"):
2973                         [(m,160*1.0/240),"",""""""],
2974                 _(u"groat"):
2975                         [(m,4*1.0/240),"","""Equal to four old pence"""],
2976                 _(u"pony"):
2977                         [(m,25.0),"","""Equal to twenty five pounds sterling"""],
2978
2979         },
2980
2981         }
2982
2983 future_dic = {
2984
2985
2986
2987         _(u"Wire Gauge"):{".base_unit":"circular mils",
2988                 _(u"circular mil"):
2989                         [(m,1.0),u"CM",''],
2990                 _(u"square mil"):
2991                         [(m,1.0),u'',''],
2992                 _(u"square milimetres"):
2993                         [(m,1.0),u"mm\xb2",''],
2994                 _(u"AWG"):
2995                         [(m,1.0),"AWG",_(u"American Wire Gauge")],
2996                 _(u"Diameter mils"):
2997                         [(m,1.0),"mil",''],
2998                 _(u"Diameter inches"):
2999                         [(m,1.0),"in",''],
3000                 _(u"Diameter mm"):
3001                         [(m,1.0),"mm",''],
3002                 _(u"Diameter m"):
3003                         [(m,1.0),"m",''],
3004                 _(u"Ampacity Cu"):
3005                         [(m,1.0),"A",_(u"Copper wire ampacity")],
3006                 _(u"Ampacity Al"):
3007                         [(m,1.0),"A",_(u"Aluminum wire ampacity")],
3008                 _(u"Resistance of Cu wire at xxdegC"):
3009                         [(m,1.0),"ohms/kft",_(u"Copper wire resistance.")],
3010                 _(u"Resistance of Cu wire at xxdegC"):
3011                         [(m,1.0),"ohms/ft",_(u"Copper wire resistance.")],
3012                 _(u"Resistance of Cu wire at xxdegC"):
3013                         [(m,1.0),"ohms/m",_(u"Copper wire resistance.")],
3014                 _(u"Resistance of Cu wire at xxdegC"):
3015                         [(m,1.0),"ohms/km",_(u"Copper wire resistance.")],
3016                 _(u"Resistance of Al wire at xxdegC"):
3017                         [(m,1.0),"ohms/kft",_(u"Copper wire resistance.")],
3018                 _(u"Resistance of Al wire at xxdegC"):
3019                         [(m,1.0),"ohms/ft",_(u"Copper wire resistance.")],
3020                 _(u"Resistance of Al wire at xxdegC"):
3021                         [(m,1.0),"ohms/m",_(u"Copper wire resistance.")],
3022                 _(u"Resistance of Al wire at xxdegC"):
3023                         [(m,1.0),"ohms/km",_(u"Copper wire resistance.")],
3024                 _(u"Length per Weight Cu Wire"):
3025                         [(m,1.0),"ft/lb (Cu)",_(u"Length per weight Copper Wire.")],
3026                 _(u"Length per Weight Al Wire"):
3027                         [(m,1.0),"ft/lb (Al)",_(u"Length per weight Aluminum Wire.")],
3028                 _(u"Length per resistance Cu Wire"):
3029                         [(m,1.0),"ft/ohm (Cu)",_(u"Length per resistance Copper Wire.")],
3030                 _(u"Length per resistance Al Wire"):
3031                         [(m,1.0),"ft/ohm (Al)",_(u"Length per resistance Aluminum Wire.")],
3032                 _(u"Weight Cu wire"):
3033                         [(m,1.0),"kg/km (Cu)",_(u"Copper wire weight.")],
3034                 _(u"Weight Al wire"):
3035                         [(m,1.0),"kg/km (Al)",_(u"Aluminum wire weight.")],
3036                 _(u"Weight Cu wire"):
3037                         [(m,1.0),"lb/kft (Cu)",_(u"Copper wire weight in pounds per 1000 feet.")],
3038                 _(u"Weight Al wire"):
3039                         [(m,1.0),"lb/kft (Al)",_(u"Aluminum wire weight in pounds per 1000 feet.")],
3040                 _(u"Tensile strength"):
3041                         [(m,1.0),"kgf",_(u"Aluminum wire weight.")],
3042                 _(u"Turns per inch"):
3043                         [(m,1.0),"TPI",_(u"Turns per inch of bare wire, useful for winding coils. This value is approximate and will be reduced with insulated wire")],
3044         },}
3045
3046
3047 list_items = []
3048
3049 keys=list_dic.keys()
3050 keys.sort()
3051
3052 #insert a column into the units list even though the heading will not be seen
3053 renderer = gtk.CellRendererText()
3054 column1 = gtk.TreeViewColumn( _('Unit Name'), renderer )
3055 column1.set_property( 'resizable', 1 )
3056 column1.add_attribute( renderer, 'text', 0 )
3057 column1.set_clickable(True)
3058 column1.connect("clicked",click_column)
3059 clist1.append_column( column1 )
3060
3061 column2 = gtk.TreeViewColumn( _('Value'), renderer )
3062 column2.set_property( 'resizable', 1 )
3063 column2.add_attribute( renderer, 'text', 1 )
3064 column2.set_clickable(True)
3065 column2.connect("clicked",click_column)
3066 clist1.append_column( column2 )
3067
3068 column3 = gtk.TreeViewColumn( _('Units'), renderer )
3069 column3.set_property( 'resizable', 1 )
3070 column3.add_attribute( renderer, 'text', 2 )
3071 column3.set_clickable(True)
3072 column3.connect("clicked",click_column)
3073 clist1.append_column( column3 )
3074
3075 #Insert a column into the category list even though the heading will not be seen
3076 renderer = gtk.CellRendererText()
3077 col = gtk.TreeViewColumn( 'Title', renderer )
3078 col.set_property( 'resizable', 1 )
3079 col.add_attribute( renderer, 'text', 0 )
3080 cat_clist.append_column( col )
3081
3082 cat_model = gtk.ListStore(gobject.TYPE_STRING)
3083 cat_clist.set_model(cat_model)
3084 #colourize each row differently for easier reading
3085 cat_clist.set_property( 'rules_hint',1)
3086
3087 #Populate the catagories list
3088 for key in keys:
3089   iter = cat_model.append()
3090   cat_model.set(iter,0,key)
3091
3092 if os.path.exists(home+'/.gonvert/bookmarks.dat'):
3093         bookmarks=pickle.load(open(home+'/.gonvert/bookmarks.dat'))
3094         print bookmarks
3095
3096 ToolTips=gtk.Tooltips()
3097 find_button  = widgets.get_widget('find_button')
3098 ToolTips.set_tip(find_button,_(u'Find unit (F6)'))
3099
3100 #Restore selections from previously saved settings if it exists and is valid.
3101 historical_catergory_found=False
3102 if os.path.exists(home+'/.gonvert/selections.dat'):
3103   #Retrieving previous selections from ~/.gonvert/selections.dat
3104   selections=pickle.load(open(home+'/.gonvert/selections.dat','r'))
3105   #Restoring previous selections.
3106   #
3107   #Make a list of categories to determine which one to select
3108   categories=list_dic.keys()
3109   categories.sort()
3110   #
3111   #If the 'selected_unts' has been stored, then extract selected_units from selections.
3112   if selections.has_key('selected_units'):
3113     selected_units=selections['selected_units']
3114   #Make sure that the 'selected_category' has been stored.
3115   if selections.has_key('selected_category'):
3116     #Match an available category to the previously selected category.
3117     for counter in range(len(categories)):
3118       if selections['selected_category']==categories[counter]:
3119         # Restore the previously selected category.
3120         cat_clist.set_cursor(counter, col, False )
3121         cat_clist.grab_focus()
3122         historical_catergory_found=True
3123
3124 if not historical_catergory_found:
3125   print "Couldn't find saved category, using default."
3126   #If historical records were not kept then default to 
3127   # put the focus on the first category
3128   cat_clist.set_cursor(0, col, False )
3129   cat_clist.grab_focus()
3130
3131 restore_units()
3132
3133
3134 gtk.main()
3135