Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
switch between python 2.7 and 3.4 when publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Apr 18, 2015
1 parent 1412a0c commit 918f95e
Showing 1 changed file with 48 additions and 29 deletions.
77 changes: 48 additions & 29 deletions src/ensae_teaching_cs/automation/ftp_publish_helper.py
Expand Up @@ -196,34 +196,53 @@ def publish_documentation(
location = project["local"]
root_local = project["root_local"]
root_web = project["root_web"]

fLOG("-------------------------", location)

sfile = project["status_file"]
rootw = project["root_web"]

ftn = FileTreeNode(root_local)
fftp = FolderTransferFTP(ftn, ftp, sfile,
root_web=rootw,
fLOG=fLOG,
footer_html=footer_html,
content_filter=content_filter,
is_binary=is_binary,
text_transform=text_transform,
filter_out=filter_out)

fftp.start_transfering()

ftn = FileTreeNode(os.path.join(root_local, ".."),
filter=lambda root, path, f, dir: not dir)
fftp = FolderTransferFTP(ftn, ftp, sfile,
root_web=root_web.replace("helpsphinx", ""),
fLOG=fLOG,
footer_html=footer_html,
content_filter=content_filter,
is_binary=is_binary,
text_transform=text_transform)

fftp.start_transfering()

m27 = os.path.join(root_local, "..", "..", "dist_module27")
if os.path.exists(m27):
# python 27.version
fLOG("-------------------------", m27)
ftn = FileTreeNode(os.path.join(root_local, ".."),
filter=lambda root, path, f, dir: not dir)
fftp = FolderTransferFTP(ftn, ftp, sfile,
root_web=root_web.replace("helpsphinx", ""),
fLOG=fLOG,
footer_html=footer_html,
content_filter=content_filter,
is_binary=is_binary,
text_transform=text_transform)

fftp.start_transfering()
else:
# python 3.4 documentation + setup
fLOG("-------------------------", location)

sfile = project["status_file"]
rootw = project["root_web"]

ftn = FileTreeNode(root_local)
fftp = FolderTransferFTP(ftn, ftp, sfile,
root_web=rootw,
fLOG=fLOG,
footer_html=footer_html,
content_filter=content_filter,
is_binary=is_binary,
text_transform=text_transform,
filter_out=filter_out)

fftp.start_transfering()

ftn = FileTreeNode(os.path.join(root_local, ".."),
filter=lambda root, path, f, dir: not dir)
fftp = FolderTransferFTP(ftn, ftp, sfile,
root_web=root_web.replace("helpsphinx", ""),
fLOG=fLOG,
footer_html=footer_html,
content_filter=content_filter,
is_binary=is_binary,
text_transform=text_transform)

fftp.start_transfering()



ftp.close()

0 comments on commit 918f95e

Please sign in to comment.