@@ -532,21 +532,24 @@ def open_all_libraries_and_examples(self, url, logfile):
532
532
compile_type = 'fetch'
533
533
urls_to_visit , log_entry , log_file , log_time = self .resume_log (logfile , compile_type , examples_libraries )
534
534
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/.+/.+$' )
537
538
538
539
print '\n Visiting:' , len (urls_to_visit ), 'URLs'
539
540
tic = time .time ()
540
541
for url in urls_to_visit :
541
542
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
547
550
548
551
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 ) :
550
553
test_status = False
551
554
elif example_re .match (url ) and 'Sorry! The example could not be fetched.' in self .driver .page_source :
552
555
test_status = False
0 commit comments