Ticket #18562: patch-disable_optional_deps.diff
File patch-disable_optional_deps.diff, 5.0 KB (added by krunk7@…, 16 years ago) |
---|
-
setupext.py
old new 350 350 return '.'.join(temp) 351 351 352 352 def check_for_qt(): 353 try: 354 import pyqtconfig 355 except ImportError: 353 MP_QT=False 354 if MP_QT: 355 try: 356 import pyqtconfig 357 except ImportError: 358 print_status("Qt", "no") 359 return False 360 else: 361 try: 362 qt_version = pyqtconfig.Configuration().qt_version 363 qt_version = convert_qt_version(qt_version) 364 except AttributeError: 365 qt_version = "<unknown>" 366 print_status("Qt", "Qt: %s, PyQt: %s" % 367 (qt_version, 368 pyqtconfig.Configuration().pyqt_version_str)) 369 return True 370 else: 356 371 print_status("Qt", "no") 357 372 return False 358 else:359 try:360 qt_version = pyqtconfig.Configuration().qt_version361 qt_version = convert_qt_version(qt_version)362 except AttributeError:363 qt_version = "<unknown>"364 print_status("Qt", "Qt: %s, PyQt: %s" %365 (qt_version,366 pyqtconfig.Configuration().pyqt_version_str))367 return True368 373 369 374 def check_for_qt4(): 370 try: 371 from PyQt4 import pyqtconfig 372 except ImportError: 375 MP_QT4=False 376 if MP_QT4: 377 try: 378 from PyQt4 import pyqtconfig 379 except ImportError: 380 print_status("Qt4", "no") 381 return False 382 else: 383 print_status("Qt4", "Qt: %s, PyQt4: %s" % 384 (convert_qt_version(pyqtconfig.Configuration().qt_version), 385 pyqtconfig.Configuration().pyqt_version_str)) 386 return True 387 else: 373 388 print_status("Qt4", "no") 374 389 return False 375 else:376 print_status("Qt4", "Qt: %s, PyQt4: %s" %377 (convert_qt_version(pyqtconfig.Configuration().qt_version),378 pyqtconfig.Configuration().pyqt_version_str))379 return True380 390 381 391 def check_for_cairo(): 382 try: 383 import cairo 384 except ImportError: 392 MP_Cairo=False 393 if MP_Cairo: 394 try: 395 import cairo 396 except ImportError: 397 print_status("Cairo", "no") 398 return False 399 else: 400 print_status("Cairo", cairo.version) 401 return True 402 else: 385 403 print_status("Cairo", "no") 386 404 return False 387 else:388 print_status("Cairo", cairo.version)389 return True390 405 391 406 def check_for_datetime(): 392 407 try: … … 503 518 return False 504 519 505 520 def check_for_dvipng(): 506 try: 507 stdin, stdout = run_child_process('dvipng -version') 508 print_status("dvipng", stdout.readlines()[1].split()[-1]) 509 return True 510 except (IndexError, ValueError): 521 MP_LaTeX=False 522 if MP_LaTeX: 523 try: 524 stdin, stdout = run_child_process('dvipng -version') 525 print_status("dvipng", stdout.readlines()[1].split()[-1]) 526 return True 527 except (IndexError, ValueError): 528 print_status("dvipng", "no") 529 return False 530 else: 511 531 print_status("dvipng", "no") 512 532 return False 513 533 514 534 def check_for_ghostscript(): 515 try: 516 if sys.platform == 'win32': 517 command = 'gswin32c --version' 518 else: 519 command = 'gs --version' 520 stdin, stdout = run_child_process(command) 521 print_status("ghostscript", stdout.read()[:-1]) 522 return True 523 except (IndexError, ValueError): 535 MP_GhostScript=False 536 if MP_GhostScript: 537 try: 538 if sys.platform == 'win32': 539 command = 'gswin32c --version' 540 else: 541 command = 'gs --version' 542 stdin, stdout = run_child_process(command) 543 print_status("ghostscript", stdout.read()[:-1]) 544 return True 545 except (IndexError, ValueError): 546 print_status("ghostscript", "no") 547 return False 548 else: 524 549 print_status("ghostscript", "no") 525 return False550 return True 526 551 527 552 def check_for_latex(): 528 try: 529 stdin, stdout = run_child_process('latex -version') 530 line = stdout.readlines()[0] 531 pattern = '3\.1\d+' 532 match = re.search(pattern, line) 533 print_status("latex", match.group(0)) 534 return True 535 except (IndexError, ValueError, AttributeError): 553 MP_LaTeX=False 554 if MP_LaTeX: 555 try: 556 stdin, stdout = run_child_process('latex -version') 557 line = stdout.readlines()[0] 558 pattern = '3\.1\d+' 559 match = re.search(pattern, line) 560 print_status("latex", match.group(0)) 561 return True 562 except (IndexError, ValueError, AttributeError): 563 print_status("latex", "no") 564 return False 565 else: 536 566 print_status("latex", "no") 537 567 return False 538 568