Package GChartWrapper :: Module constants
[hide private]
[frames] | no frames]

Source Code for Module GChartWrapper.constants

  1  import sys 
  2   
3 -def _print(*args):
4 for arg in args: 5 sys.stdout.write('%s '%arg) 6 sys.stdout.write('\n')
7 8 if sys.version.startswith('3.0'): 9 PY_VER = '3.x' 10 from urllib.parse import quote_plus,parse_qsl 11 from urllib.request import urlopen,urlretrieve 12 else: 13 PY_VER = '2.x' 14 from urllib import quote_plus,urlretrieve 15 from urllib2 import urlopen, Request, URLError, HTTPError 16 from cgi import parse_qsl 17
18 -def quote(s):
19 try: 20 return quote_plus(s.encode('utf-8'),'+.,:|/?&$=') 21 except: 22 return quote_plus(s,'+.,:|/?&$=')
23
24 -def smart_str(s):
25 try: 26 s = quote(s) 27 except: 28 pass 29 if PY_VER == '2.x': 30 return unicode(s).encode('utf-8') # Py2K 31 return str(s)#.encode('utf-8') # Py3K
32 33 APIPARAMS = ('chxtc', 'chxt', 'chxp', 'chxs', 'chxr', 'chco', 'chtm', 'chld', 34 'chts', 'chtt', 'chxl', 'chd', 'chf', 'chg', 'chl', 'chm', 'chp', 'chs', 35 'cht', 'chls', 'chdlp', 'chds', 'chbh', 'chdl', 'choe', 'chst') 36 37 MARKERS = 'acdostvVhxrRbBDF' 38 39 TYPES = ('bvs', 'p3', 'qr', 'lc', 'p', 'bhg', 'pc', 's', 'r', 'rs', 'bvg', 't', 40 'v', 'lxy', 'bhs', 'gom', 'ls') 41 42 IMGATTRS = ('title','alt','align','border','height','width','ismap','longdesc', 43 'usemap','id','class','style','lang','xml:lang','onclick','ondblclick','onmousedown', 44 'onmouseup','onmouseover','onmousemove','onmouseout','onkeypress','onkeydown','onkeyup') 45 46 GEO = ('africa','asia','europe','middle_east','south_america','usa','world') 47 48 TTAGSATTRS = ('label','title','color','line','grid','bar','marker','fill','legend','axes', 49 'encoding','scale','size','type','dataset','img','map','bar_width_spacing', 50 'legend_pos','output_encoding','level_data') 51 52 APIURL = 'http://chart.apis.google.com/chart?' 53 54 COLOR_MAP = { 55 'aliceblue': 'F0F8FF', 56 'antiquewhite': 'FAEBD7', 57 'aqua': '00FFFF', 58 'aquamarine': '7FFFD4', 59 'azure': 'F0FFFF', 60 'beige': 'F5F5DC', 61 'bisque': 'FFE4C4', 62 'black': '000000', 63 'blanchedalmond': 'FFEBCD', 64 'blue': '0000FF', 65 'blueviolet': '8A2BE2', 66 'brown': 'A52A2A', 67 'burlywood': 'DEB887', 68 'cadetblue': '5F9EA0', 69 'chartreuse': '7FFF00', 70 'chocolate': 'D2691E', 71 'coral': 'FF7F50', 72 'cornflowerblue': '6495ED', 73 'cornsilk': 'FFF8DC', 74 'crimson': 'DC143C', 75 'cyan': '00FFFF', 76 'darkblue': '00008B', 77 'darkcyan': '008B8B', 78 'darkgoldenrod': 'B8860B', 79 'darkgray': 'A9A9A9', 80 'darkgreen': '006400', 81 'darkkhaki': 'BDB76B', 82 'darkmagenta': '8B008B', 83 'darkolivegreen': '556B2F', 84 'darkorange': 'FF8C00', 85 'darkorchid': '9932CC', 86 'darkred': '8B0000', 87 'darksalmon': 'E9967A', 88 'darkseagreen': '8FBC8F', 89 'darkslateblue': '483D8B', 90 'darkslategray': '2F4F4F', 91 'darkturquoise': '00CED1', 92 'darkviolet': '9400D3', 93 'deeppink': 'FF1493', 94 'deepskyblue': '00BFFF', 95 'dimgray': '696969', 96 'dodgerblue': '1E90FF', 97 'firebrick': 'B22222', 98 'floralwhite': 'FFFAF0', 99 'forestgreen': '228B22', 100 'fuchsia': 'FF00FF', 101 'gainsboro': 'DCDCDC', 102 'ghostwhite': 'F8F8FF', 103 'gold': 'FFD700', 104 'goldenrod': 'DAA520', 105 'gray': '808080', 106 'green': '008000', 107 'greenyellow': 'ADFF2F', 108 'honeydew': 'F0FFF0', 109 'hotpink': 'FF69B4', 110 'indianred ': 'CD5C5C', 111 'indigo ': '4B0082', 112 'ivory': 'FFFFF0', 113 'khaki': 'F0E68C', 114 'lavender': 'E6E6FA', 115 'lavenderblush': 'FFF0F5', 116 'lawngreen': '7CFC00', 117 'lemonchiffon': 'FFFACD', 118 'lightblue': 'ADD8E6', 119 'lightcoral': 'F08080', 120 'lightcyan': 'E0FFFF', 121 'lightgoldenrodyellow': 'FAFAD2', 122 'lightgrey': 'D3D3D3', 123 'lightgreen': '90EE90', 124 'lightpink': 'FFB6C1', 125 'lightsalmon': 'FFA07A', 126 'lightseagreen': '20B2AA', 127 'lightskyblue': '87CEFA', 128 'lightslategray': '778899', 129 'lightsteelblue': 'B0C4DE', 130 'lightyellow': 'FFFFE0', 131 'lime': '00FF00', 132 'limegreen': '32CD32', 133 'linen': 'FAF0E6', 134 'magenta': 'FF00FF', 135 'maroon': '800000', 136 'mediumaquamarine': '66CDAA', 137 'mediumblue': '0000CD', 138 'mediumorchid': 'BA55D3', 139 'mediumpurple': '9370D8', 140 'mediumseagreen': '3CB371', 141 'mediumslateblue': '7B68EE', 142 'mediumspringgreen': '00FA9A', 143 'mediumturquoise': '48D1CC', 144 'mediumvioletred': 'C71585', 145 'midnightblue': '191970', 146 'mintcream': 'F5FFFA', 147 'mistyrose': 'FFE4E1', 148 'moccasin': 'FFE4B5', 149 'navajowhite': 'FFDEAD', 150 'navy': '000080', 151 'oldlace': 'FDF5E6', 152 'olive': '808000', 153 'olivedrab': '6B8E23', 154 'orange': 'FFA500', 155 'orangered': 'FF4500', 156 'orchid': 'DA70D6', 157 'palegoldenrod': 'EEE8AA', 158 'palegreen': '98FB98', 159 'paleturquoise': 'AFEEEE', 160 'palevioletred': 'D87093', 161 'papayawhip': 'FFEFD5', 162 'peachpuff': 'FFDAB9', 163 'peru': 'CD853F', 164 'pink': 'FFC0CB', 165 'plum': 'DDA0DD', 166 'powderblue': 'B0E0E6', 167 'purple': '800080', 168 'red': 'FF0000', 169 'rosybrown': 'BC8F8F', 170 'royalblue': '4169E1', 171 'saddlebrown': '8B4513', 172 'salmon': 'FA8072', 173 'sandybrown': 'F4A460', 174 'seagreen': '2E8B57', 175 'seashell': 'FFF5EE', 176 'sienna': 'A0522D', 177 'silver': 'C0C0C0', 178 'skyblue': '87CEEB', 179 'slateblue': '6A5ACD', 180 'slategray': '708090', 181 'snow': 'FFFAFA', 182 'springgreen': '00FF7F', 183 'steelblue': '4682B4', 184 'tan': 'D2B48C', 185 'teal': '008080', 186 'thistle': 'D8BFD8', 187 'tomato': 'FF6347', 188 'turquoise': '40E0D0', 189 'violet': 'EE82EE', 190 'wheat': 'F5DEB3', 191 'white': 'FFFFFF', 192 'whitesmoke': 'F5F5F5', 193 'yellow': 'FFFF00', 194 'yellowgreen': '9ACD32' 195 } 196 PIN_TYPES = ('pin_letter','pin_icon','xpin_letter','xpin_icon','spin') 197 PIN_ICONS = ('home', 'home', 'WC', 'WCfemale', 'WCmale', 'accomm', 'airport', 198 'baby', 'bar', 'bicycle', 'bus', 'cafe', 'camping', 'car', 'caution', 'cinema', 199 'computer', 'corporate', 'dollar', 'euro', 'fire', 'flag', 'floral', 'helicopter', 200 'home', 'info', 'landslide', 'legal', 'location', 'locomotive', 'medical', 201 'mobile', 'motorcycle', 'music', 'parking', 'pet', 'petrol', 'phone', 'picnic', 202 'postal', 'pound', 'repair', 'restaurant', 'sail', 'school', 'scissors', 'ship', 203 'shoppingbag', 'shoppingcart', 'ski', 'snack', 'snow', 'sport', 'swim', 'taxi', 204 'train', 'truck', 'wheelchair', 'yen') 205 PIN_SHAPES = ('pin','star','sleft','sright') 206 NOTE_TYPES = ('note_title','note','weather') 207 NOTE_IMAGES = ('arrow_d', 'balloon', 'pinned_c', 'sticky_y', 'taped_y', 'thought') 208 NOTE_WEATHERS = ('clear-night-moon', 'cloudy-heavy', 'cloudy-sunny', 'cloudy', 209 'rain', 'rainy-sunny', 'snow', 'snowflake', 'snowy-sunny', 'sunny-cloudy', 210 'sunny', 'thermometer-cold', 'thermometer-hot', 'thunder', 'windy') 211 BUBBLE_TYPES = ('icon_text_small','icon_text_big','icon_texts_big','texts_big') 212 BUBBLE_SICONS = ('WC', 'WCfemale', 'WCmale', 'accomm', 'airport', 'baby', 'bar', 213 'bicycle', 'bus', 'cafe', 'camping', 'car', 'caution', 'cinema', 'computer', 214 'corporate', 'dollar', 'euro', 'fire', 'flag', 'floral', 'helicopter', 'home', 215 'info', 'landslide', 'legal', 'location', 'locomotive', 'medical', 'mobile', 216 'motorcycle', 'music', 'parking', 'pet', 'petrol', 'phone', 'picnic', 'postal', 217 'pound', 'repair', 'restaurant', 'sail', 'school', 'scissors', 'ship', 'shoppingbag', 218 'shoppingcart', 'ski', 'snack', 'snow', 'sport', 'swim', 'taxi', 'train', 219 'truck', 'wheelchair', 'yen') 220 BUBBLE_LICONS = ('beer', 'bike', 'car', 'house', 'petrol', 'ski', 'snack') 221 LEGEND_POSITIONS = ('b','t','r','l','bv','tv') 222