<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from lxml import html <EOL> import os <EOL> import urllib2 <EOL> abs_path = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> CMS_EXPLORER_DIR = os . path . join ( abs_path , "<STR_LIT>" ) <EOL> def get_plugins_wp ( ) : <EOL> r = urllib2 . Request ( "<STR_LIT>" ) <EOL> content = urllib2 . urlopen ( r ) <EOL> tree = html . fromstring ( content . read ( ) ) <EOL> el_list = tree . find ( '<STR_LIT:body>' ) . find ( '<STR_LIT>' ) . findall ( '<STR_LIT>' ) <EOL> plugins = [ ] <EOL> for el in el_list : <EOL> plugins . append ( el . text_content ( ) ) <EOL> with open ( "<STR_LIT>" % CMS_EXPLORER_DIR , "<STR_LIT>" ) as file : <EOL> for plugin in plugins : <EOL> file . write ( "<STR_LIT>" % plugin . encode ( '<STR_LIT:ascii>' , '<STR_LIT:ignore>' ) ) <EOL> print ( "<STR_LIT>" ) <EOL> def get_themes_wp ( ) : <EOL> r = urllib2 . Request ( "<STR_LIT>" ) <EOL> content = urllib2 . urlopen ( r ) <EOL> tree = html . fromstring ( content . read ( ) ) <EOL> el_list = tree . find ( '<STR_LIT:body>' ) . find ( '<STR_LIT>' ) . findall ( '<STR_LIT>' ) <EOL> themes = [ ] <EOL> for el in el_list : <EOL> themes . append ( el . text_content ( ) ) <EOL> with open ( "<STR_LIT>" % CMS_EXPLORER_DIR , "<STR_LIT>" ) as file : <EOL> for theme in themes : <EOL> file . write ( "<STR_LIT>" % theme . encode ( '<STR_LIT:ascii>' , '<STR_LIT:ignore>' ) ) <EOL> print ( "<STR_LIT>" ) <EOL> def get_drupal_plugins ( ) : <EOL> r = urllib2 . Request ( "<STR_LIT>" ) <EOL> content = urllib2 . urlopen ( r ) <EOL> tree = html . fromstring ( content . read ( ) ) <EOL> links = tree . xpath ( '<STR_LIT>' ) <EOL> modules = [ ] <EOL> for el in links : <EOL> string = el . get ( '<STR_LIT>' ) <EOL> module = string . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> modules . append ( module ) <EOL> with open ( "<STR_LIT>" % CMS_EXPLORER_DIR , "<STR_LIT>" ) as file : <EOL> for module in modules : <EOL> file . write ( "<STR_LIT>" % module . encode ( '<STR_LIT:ascii>' , '<STR_LIT:ignore>' ) ) <EOL> print ( "<STR_LIT>" ) <EOL> def get_drupal_themes ( ) : <EOL> r = urllib2 . Request ( "<STR_LIT>" ) <EOL> content = urllib2 . urlopen ( r ) <EOL> tree = html . fromstring ( content . read ( ) ) <EOL> links = tree . xpath ( '<STR_LIT>' ) <EOL> themes = [ ] <EOL> for el in links : <EOL> string = el . get ( '<STR_LIT>' ) <EOL> theme = string . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> themes . append ( theme ) <EOL> with open ( "<STR_LIT>" % CMS_EXPLORER_DIR , "<STR_LIT>" ) as file : <EOL> for theme in themes : <EOL> file . write ( '<STR_LIT>' % theme . encode ( '<STR_LIT:ascii>' , '<STR_LIT:ignore>' ) ) <EOL> print ( "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> get_plugins_wp ( ) <EOL> get_themes_wp ( ) <EOL> get_drupal_plugins ( ) <EOL> get_drupal_themes ( ) </s>
