|
a/scripts/teamforge-import.py |
|
b/scripts/teamforge-import.py |
|
... |
|
... |
766 |
log.warn('did not find homepage')
|
766 |
log.warn('did not find homepage')
|
767 |
|
767 |
|
768 |
if homepage:
|
768 |
if homepage:
|
769 |
save(homepage, project, 'wiki', 'homepage_text.markdown')
|
769 |
save(homepage, project, 'wiki', 'homepage_text.markdown')
|
770 |
for img_ref in find_image_references(homepage):
|
770 |
for img_ref in find_image_references(homepage):
|
|
|
771 |
if '://' in img_ref:
|
|
|
772 |
img_url = img_ref
|
|
|
773 |
else:
|
771 |
filename = img_ref.split('/')[-1]
|
774 |
filename = img_ref.split('/')[-1]
|
|
|
775 |
img_url = project.path + '/wiki/' + img_ref
|
772 |
download_file('wiki', project.path + '/wiki/' + img_ref, project.id, 'wiki', 'homepage', filename)
|
776 |
download_file('wiki', img_url, project.id, 'wiki', 'homepage', filename)
|
773 |
|
777 |
|
774 |
for path, text in pages.iteritems():
|
778 |
for path, text in pages.iteritems():
|
775 |
if options.default_wiki_text in text:
|
779 |
if options.default_wiki_text in text:
|
776 |
log.debug('skipping default wiki page %s' % path)
|
780 |
log.debug('skipping default wiki page %s' % path)
|
777 |
else:
|
781 |
else:
|
778 |
save(text, project, 'wiki', path+'.markdown')
|
782 |
save(text, project, 'wiki', path+'.markdown')
|
779 |
for img_ref in find_image_references(text):
|
783 |
for img_ref in find_image_references(text):
|
|
|
784 |
if '://' in img_ref:
|
|
|
785 |
img_url = img_ref
|
|
|
786 |
else:
|
780 |
filename = img_ref.split('/')[-1]
|
787 |
filename = img_ref.split('/')[-1]
|
|
|
788 |
img_url = project.path + '/wiki/' + img_ref
|
781 |
download_file('wiki', project.path + '/wiki/' + img_ref, project.id, 'wiki', path, filename)
|
789 |
download_file('wiki', img_url, project.id, 'wiki', path, filename)
|
782 |
|
790 |
|
783 |
def _dir_sql(created_on, project, dir_name, rel_path):
|
791 |
def _dir_sql(created_on, project, dir_name, rel_path):
|
784 |
assert options.neighborhood_shortname
|
792 |
assert options.neighborhood_shortname
|
785 |
if not rel_path:
|
793 |
if not rel_path:
|
786 |
parent_directory = "'1'"
|
794 |
parent_directory = "'1'"
|