Commits
91 91 | |
92 92 | parser=argparse.ArgumentParser() |
93 93 | parser.add_argument('--version', help='version') |
94 94 | parser.add_argument('bdist_wheel', help='bdist_wheel') |
95 95 | args=parser.parse_args() |
96 96 | |
97 97 | print (args.version) |
98 98 | |
99 99 | module_name = 'casatasks' |
100 100 | |
101 - | pyversion = float(sys.version_info[0]) + float(sys.version_info[1]) / 10.0 |
102 - | |
103 - | if pyversion < 3: |
104 - | str_encode = str |
105 - | str_decode = str |
106 - | def pipe_decode(output): |
107 - | return output |
108 - | else: |
109 - | def str_encode(s): |
110 - | return bytes(s,sys.getdefaultencoding()) |
111 - | def str_decode(bs): |
112 - | return bs.decode(sys.getdefaultencoding(),"strict") |
113 - | def pipe_decode(output): |
114 - | if isinstance(output,bytes) or isinstance(output,bytearray): |
115 - | return str_decode(output) |
116 - | elif isinstance(output,tuple): |
117 - | return (str_decode(output[0]),str_decode(output[1])) |
118 - | else: |
119 - | return ("","") |
101 + | pyversion = ".".join(tuple(str(x) for x in sys.version_info[0:2])) |
102 + | |
103 + | def str_encode(s): |
104 + | return bytes(s,sys.getdefaultencoding()) |
105 + | def str_decode(bs): |
106 + | return bs.decode(sys.getdefaultencoding(),"strict") |
107 + | def pipe_decode(output): |
108 + | if isinstance(output,bytes) or isinstance(output,bytearray): |
109 + | return str_decode(output) |
110 + | elif isinstance(output,tuple): |
111 + | return (str_decode(output[0]),str_decode(output[1])) |
112 + | else: |
113 + | return ("","") |
120 114 | |
121 115 | def compute_version( ): |
122 116 | if (args.version != None ): |
123 117 | print (args.version.split(".")) |
124 118 | (major, minor, patch, feature) = args.version.split(".") |
125 119 | return(int(major), int(minor), int(patch), int(feature),"","","") |
126 120 | else: |
127 121 | proc = Popen( [ "./version" ], stdout=PIPE, stderr=PIPE ) |
128 122 | out,err = pipe_decode(proc.communicate( )) |
129 123 | print(out) |
276 270 | 'xml/fringefit.xml', |
277 271 | 'xml/plotbandpass.xml', |
278 272 | 'xml/sdintimaging.xml', |
279 273 | 'xml/sdpolaverage.xml', |
280 274 | 'xml/sdsidebandsplit.xml', |
281 275 | 'xml/plotprofilemap.xml', |
282 276 | 'xml/imbaseline.xml', |
283 277 | 'xml/wvrgcal.xml', |
284 278 | ] |
285 279 | |
286 - | if pyversion < 3: |
287 - | str_encode = str |
288 - | str_decode = str |
289 - | def pipe_decode(output): |
290 - | return output |
291 - | else: |
292 - | def str_encode(s): |
293 - | return bytes(s,sys.getdefaultencoding()) |
294 - | def str_decode(bs): |
295 - | return bs.decode(sys.getdefaultencoding(),"strict") |
296 - | def pipe_decode(output): |
297 - | if isinstance(output,bytes) or isinstance(output,bytearray): |
298 - | return str_decode(output) |
299 - | elif isinstance(output,tuple): |
300 - | return ( None if output[0] is None else str_decode(output[0]), None if output[1] is None else str_decode(output[1]) ) |
301 - | else: |
302 - | return ("","") |
280 + | def str_encode(s): |
281 + | return bytes(s,sys.getdefaultencoding()) |
282 + | def str_decode(bs): |
283 + | return bs.decode(sys.getdefaultencoding(),"strict") |
284 + | def pipe_decode(output): |
285 + | if isinstance(output,bytes) or isinstance(output,bytearray): |
286 + | return str_decode(output) |
287 + | elif isinstance(output,tuple): |
288 + | return ( None if output[0] is None else str_decode(output[0]), None if output[1] is None else str_decode(output[1]) ) |
289 + | else: |
290 + | return ("","") |
303 291 | |
304 292 | if sys.platform == 'darwin': |
305 293 | def islib(l): |
306 294 | return l.endswith('.dylib') |
307 295 | elif sys.platform == 'linux2' or sys.platform == 'linux': |
308 296 | def islib(l): |
309 297 | # 'lib_....so |
310 298 | return l.find('.so') > 3 |
311 299 | else: |
312 300 | sys.exit("oops, had not planned on building on %s" % sys.platform) |