mirror of
https://github.com/vale981/jobmanager
synced 2025-03-05 09:51:38 -05:00
commit
c653744296
3 changed files with 31 additions and 14 deletions
|
@ -1,4 +1,10 @@
|
|||
include examples/*.py
|
||||
include examples/advanced/*.py
|
||||
include doc/*
|
||||
include README.md
|
||||
include tests/*.py
|
||||
include tests/*.md
|
||||
include doc/*.py
|
||||
include doc/*.rst
|
||||
include doc/*.md
|
||||
include doc/*.txt
|
||||
include doc/artwork/*
|
||||
|
|
|
@ -9,29 +9,36 @@ import subprocess as sp
|
|||
os.chdir(dirname(dirname(abspath(__file__))))
|
||||
|
||||
|
||||
def checkout_master():
|
||||
def checkout_master(stashed):
|
||||
# go back to master
|
||||
sp.check_output(["git", 'checkout', 'master'])
|
||||
|
||||
print("Applying saved stash.")
|
||||
# get last stash
|
||||
sp.check_output(["git", 'stash', 'apply'])
|
||||
if stashed:
|
||||
print("Applying saved stash.")
|
||||
# get last stash?
|
||||
sp.check_output(["git", 'stash', 'apply'])
|
||||
|
||||
|
||||
def checkout_ghpages():
|
||||
# commit changes of master
|
||||
print("Automatically stashing current changes.")
|
||||
sp.check_output(["git", 'stash'])
|
||||
|
||||
# checkout the gh-pages branch
|
||||
sp.check_output(["git", 'checkout', 'gh-pages'])
|
||||
try:
|
||||
sp.check_output(["git", 'checkout', 'gh-pages'])
|
||||
except:
|
||||
print("Automatically stashing current changes.")
|
||||
sp.check_output(["git", 'stash'])
|
||||
stashed = True
|
||||
sp.check_output(["git", 'checkout', 'gh-pages'])
|
||||
else:
|
||||
stashed = False
|
||||
|
||||
checkout_ghpages()
|
||||
return stashed
|
||||
|
||||
stashed = checkout_ghpages()
|
||||
|
||||
|
||||
# copy built files
|
||||
if os.system("cp -r ./build/sphinx/html/* ./") != 0:
|
||||
checkout_master()
|
||||
checkout_master(stashed)
|
||||
sys.exit()
|
||||
|
||||
for item in os.listdir("./build/sphinx/html/"):
|
||||
|
@ -49,4 +56,4 @@ try:
|
|||
except:
|
||||
print("Could not push to gh-pages.")
|
||||
|
||||
checkout_master()
|
||||
checkout_master(stashed)
|
||||
|
|
|
@ -1460,8 +1460,12 @@ ESC_BLINK = "\033[5m"
|
|||
ESC_INVERTED = "\033[7m"
|
||||
ESC_HIDDEN = "\033[8m"
|
||||
|
||||
ESC_RESET_BOLD = "\033[21m"
|
||||
# not widely supported, use '22' instead
|
||||
# ESC_RESET_BOLD = "\033[21m"
|
||||
|
||||
ESC_RESET_DIM = "\033[22m"
|
||||
ESC_RESET_BOLD = ESC_RESET_DIM
|
||||
|
||||
ESC_RESET_UNDERLINED = "\033[24m"
|
||||
ESC_RESET_BLINK = "\033[25m"
|
||||
ESC_RESET_INVERTED = "\033[27m"
|
||||
|
|
Loading…
Add table
Reference in a new issue