@@ -532,21 +532,24 @@ def open_all_libraries_and_examples(self, url, logfile):
532532 compile_type = 'fetch'
533533 urls_to_visit , log_entry , log_file , log_time = self .resume_log (logfile , compile_type , examples_libraries )
534534
535- library_re = re .compile (r'^https://codebender.cc/library/.+$' )
536- example_re = re .compile (r'^https://codebender.cc/example/.+/.+$' )
535+ libraries_re = re .compile (r'/libraries$' )
536+ library_re = re .compile (r'/library/.+$' )
537+ example_re = re .compile (r'/example/.+/.+$' )
537538
538539 print '\n Visiting:' , len (urls_to_visit ), 'URLs'
539540 tic = time .time ()
540541 for url in urls_to_visit :
541542 self .open (url )
542- url_name = url .split ('/' )[- 1 ]
543- name = self .get_element (By .CSS_SELECTOR , '#mycontainer h1 small' ).text
544- name = re .sub ('[()]' , '' , name ).split ('.' )[0 ]
545- if (name != url_name ):
546- print "Didn't open url: " , url
543+ self .get_element (By .CSS_SELECTOR , '#mycontainer h1' )
544+ if library_re .match (url ):
545+ url_name = url .split ('/' )[- 1 ]
546+ name = self .get_element (By .CSS_SELECTOR , '#mycontainer h1 small' ).text
547+ name = re .sub ('[()]' , '' , name ).split ('.' )[0 ]
548+ if (name != url_name ):
549+ print "Didn't open url: " , url
547550
548551 test_status = True
549- if library_re .match (url ) and self .driver .current_url == 'https://codebender.cc/libraries' :
552+ if library_re .match (url ) and libraries_re . match ( self .driver .current_url ) :
550553 test_status = False
551554 elif example_re .match (url ) and 'Sorry! The example could not be fetched.' in self .driver .page_source :
552555 test_status = False
@@ -630,7 +633,6 @@ def comment_compile_libraries_examples(self, sketches, library_examples_dic={},
630633
631634 # Initialize DisqusWrapper.
632635 disqus_wrapper = DisqusWrapper (log_time )
633- print "urls to visit:" , urls_to_visit
634636
635637 print '\n Commenting and compiling:' , len (urls_to_visit ), 'libraries and examples.'
636638
0 commit comments