-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added pelican-gfm plugin #1224
Open
dfoulks1
wants to merge
24
commits into
getpelican:master
Choose a base branch
from
dfoulks1:pelican-gfm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added pelican-gfm plugin #1224
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2f96d35
Added pelican-gfm plugin
dfoulks1 140ab9f
Made some changes to the pelican gfm setup script
dfoulks1 9b31101
PEP8 verified
dfoulks1 44d5b95
finished up pep8 compliance
dfoulks1 886009c
Updated Readme.md
dfoulks1 284b90e
Python3-ized everything
dfoulks1 03dfb9d
Moved Extensions definition to gfmVars
dfoulks1 963e121
Clarified some of the names for the files.
dfoulks1 469c99a
updated name
dfoulks1 922db0c
pycodestyled the scripts after changes
dfoulks1 962682a
fixed python3 import
dfoulks1 7bb9115
changed some relative pathing import issues
dfoulks1 6df3efd
Ensured that the whole thing works
dfoulks1 f9518da
Added OPTS to settings
dfoulks1 b897337
pycodestyled it and ensured it works again.
dfoulks1 788e89b
Updated readme file
dfoulks1 8b6c56e
Added a test for the register / add_readers function.
dfoulks1 d22316b
Updated error message
dfoulks1 a056e7e
Used __future__
dfoulks1 76574fb
Removed absolute imports
dfoulks1 6439c43
got absolute imports working
dfoulks1 4a932be
updated some string checking.
dfoulks1 f57cf1d
Updated Settings and Docs and some trimmed fat
dfoulks1 7e8b15c
OF: Fixed a typo
dfoulks1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/environment python -B | ||
#!/usr/bin/environment python333 -B | ||
|
||
from gfm import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/python -B | ||
#!/usr/bin/python3 -B | ||
|
||
import sys | ||
import os | ||
import subprocess | ||
import gfmVars | ||
|
||
from backports import tempfile | ||
|
||
# Eventually, equivalents for | ||
# other operating systems / package | ||
|
@@ -45,15 +45,14 @@ def dpkg_packages_installed(): | |
|
||
if len(need_to_be_removed) is not 0: | ||
raise Exception("Found the following conflicting packages\ | ||
which should be removed:\ | ||
need_to_be_installed") | ||
which should be removed:" + str(need_to_be_removed)) | ||
rem = False | ||
else: | ||
rem = True | ||
|
||
if len(need_to_be_installed) is not 0: | ||
raise Exception("Could not find the following required\ | ||
packages: need_to_be_installed") | ||
packages: " + need_to_be_installed ) | ||
ins = False | ||
else: | ||
ins = True | ||
|
@@ -63,82 +62,77 @@ def dpkg_packages_installed(): | |
return True | ||
|
||
|
||
def cleanUp(): | ||
subprocess.call(["rm", "-rf", WORKSPACE]) | ||
|
||
|
||
def setup(): | ||
dpkg_packages_installed() | ||
|
||
if test_configuration() == 1: | ||
print("System appears to be configured") | ||
# Configure the environment if it's not already configured | ||
if not os.path.isdir(WORKSPACE): | ||
os.mkdir(WORKSPACE) | ||
|
||
subprocess.call([ | ||
"wget", | ||
"--quiet", | ||
ARCHIVES + "/" + gfmVars.VERSION + ".tar.gz", | ||
WORKSPACE, | ||
"-P", | ||
WORKSPACE | ||
]) | ||
subprocess.call([ | ||
'tar', | ||
'zxf', | ||
WORKSPACE + "/" + gfmVars.VERSION + ".tar.gz", | ||
"-C", | ||
WORKSPACE | ||
] | ||
) | ||
|
||
BUILDSPACE = gfmVars.WORKSPACE + "/" + "cmark-gfm-" + gfmVars.VERSION + "/build" | ||
|
||
if not os.path.isdir(BUILDSPACE): | ||
os.mkdir(BUILDSPACE) | ||
|
||
thing1 = subprocess.Popen([ | ||
"cmake", | ||
"-DCMARK_TESTS=OFF", | ||
"-DCMARK_STATIC=OFF", | ||
".." | ||
], cwd=BUILDSPACE) | ||
thing1.wait() | ||
|
||
thing2 = subprocess.Popen(["make"], cwd=BUILDSPACE) | ||
thing2.wait() | ||
|
||
# Move the libcmark.so artifacts in place | ||
print "Moving files" | ||
subprocess.call([ | ||
"mv", | ||
BUILDSPACE + "/src/libcmark-gfm.so." + gfmVars.VERSION, | ||
gfmVars.LIBCMARKLOCATION + "libcmark-gfm.so" | ||
] | ||
) | ||
subprocess.call([ | ||
"mv", | ||
BUILDSPACE + "/extensions/libcmark-gfmextensions.so." + gfmVars.VERSION, | ||
gfmVars.LIBCMARKLOCATION + "libcmark-gfmextensions.so" | ||
] | ||
) | ||
else: | ||
# Configure the environment if it's not already configured | ||
|
||
with tempfile.TemporaryDirectory() as WORKSPACE: | ||
subprocess.call([ | ||
"wget", | ||
"--quiet", | ||
gfmVars.ARCHIVES + "/" + gfmVars.VERSION + ".tar.gz", | ||
WORKSPACE, | ||
"-P", | ||
WORKSPACE | ||
]) | ||
subprocess.call([ | ||
'tar', | ||
'zxf', | ||
WORKSPACE + "/" + gfmVars.VERSION + ".tar.gz", | ||
"-C", | ||
WORKSPACE | ||
] | ||
) | ||
|
||
BUILDSPACE = WORKSPACE + "/" + "cmark-gfm-" + gfmVars.VERSION + "/build" | ||
|
||
if not os.path.isdir(BUILDSPACE): | ||
os.mkdir(BUILDSPACE) | ||
|
||
thing1 = subprocess.Popen([ | ||
"cmake", | ||
"-DCMARK_TESTS=OFF", | ||
"-DCMARK_STATIC=OFF", | ||
".." | ||
], cwd=BUILDSPACE) | ||
thing1.wait() | ||
|
||
thing2 = subprocess.Popen(["make"], cwd=BUILDSPACE) | ||
thing2.wait() | ||
|
||
# Move the libcmark.so artifacts in place | ||
print("Moving files") | ||
subprocess.call([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there some reason you can't use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch! I ended up going with shutil for these moves. |
||
"mv", | ||
BUILDSPACE + "/src/libcmark-gfm.so." + gfmVars.VERSION, | ||
gfmVars.LIBCMARKLOCATION + "libcmark-gfm.so" | ||
] | ||
) | ||
subprocess.call([ | ||
"mv", | ||
BUILDSPACE + "/extensions/libcmark-gfmextensions.so." + gfmVars.VERSION, | ||
gfmVars.LIBCMARKLOCATION + "libcmark-gfmextensions.so" | ||
] | ||
) | ||
|
||
|
||
def test_configuration(): | ||
""" Tests to ensure that the files that the plugin needs are in place. """ | ||
CMARKPATH = gfmVars.LIBCMARKLOCATION + "/libcmark-gfm.so." + gfmVars.VERSION | ||
if os.path.isfile(gfmVars.LIBCMARKLOCATION + "/libcmark-gfm.so") and \ | ||
os.path.isfile(gfmVars.LIBCMARKLOCATION + "/libcmark-gfmextensions.so"): | ||
return 0 | ||
os.path.isfile(gfmVars.LIBCMARKLOCATION + "/libcmark-gfmextensions.so"): | ||
return True | ||
else: | ||
return 1 | ||
return False | ||
|
||
|
||
def configure(): | ||
print("Checking out the configuration") | ||
setup() | ||
cleanUp() | ||
|
||
|
||
if __name__ == "__main__": | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the
python333
a typo?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that was a typo.