new setup and print message on nopublish
This commit is contained in:
parent
30d20810d8
commit
c8f4d90d87
10
Makefile
Normal file
10
Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
clean:
|
||||
rm -rf build
|
||||
rm -rf sponge.egg-info
|
||||
rm -rf __pycache__
|
||||
|
||||
|
||||
install:
|
||||
pip install -e .
|
||||
|
||||
|
||||
@ -2,21 +2,9 @@ from __future__ import print_function
|
||||
import re, os, json, sys
|
||||
from math import ceil, floor
|
||||
from time import sleep
|
||||
|
||||
try:
|
||||
# python2
|
||||
from urlparse import urlparse, urlunparse
|
||||
from urllib2 import urlopen, URLError, HTTPError
|
||||
from urllib import urlencode
|
||||
from urllib import quote_plus, unquote_plus
|
||||
from htmlentitydefs import name2codepoint
|
||||
|
||||
input = raw_input
|
||||
except ImportError:
|
||||
# python3
|
||||
from urllib.parse import urlparse, urlunparse, urlencode, quote_plus, unquote_plus
|
||||
from urllib.request import urlopen, URLError, HTTPError
|
||||
from html.entities import name2codepoint
|
||||
from urllib.parse import urlparse, urlunparse, urlencode, quote_plus, unquote_plus
|
||||
from urllib.request import urlopen, URLError, HTTPError
|
||||
from html.entities import name2codepoint
|
||||
|
||||
groupnamepat = re.compile(r"^g\.(\w+)\$")
|
||||
def splitpadname (padid):
|
||||
@ -76,7 +64,7 @@ def getjson (url, max_retry=3, retry_sleep_time=3):
|
||||
except ValueError as e:
|
||||
url = "http://localhost" + url
|
||||
except HTTPError as e:
|
||||
print ("HTTPError {0}".format(e), file=sys.stderr)
|
||||
print ("HTTPError {0} {0}".format(url, e), file=sys.stderr)
|
||||
ret["_code"] = e.code
|
||||
ret["_retries"]+=1
|
||||
if retry_sleep_time:
|
||||
|
||||
@ -1,16 +1,9 @@
|
||||
from __future__ import print_function
|
||||
from argparse import ArgumentParser
|
||||
import sys, json, re, os
|
||||
from datetime import datetime
|
||||
|
||||
try:
|
||||
# python2
|
||||
from urllib2 import urlopen, URLError, HTTPError
|
||||
from urllib import urlencode
|
||||
except ImportError:
|
||||
# python3
|
||||
from urllib.parse import urlencode, quote
|
||||
from urllib.request import urlopen, URLError, HTTPError
|
||||
from urllib.parse import urlencode, quote
|
||||
from urllib.request import urlopen, URLError, HTTPError
|
||||
|
||||
from etherdump.commands.common import *
|
||||
from time import sleep
|
||||
@ -92,6 +85,7 @@ def main (args):
|
||||
# maxmsglen = 0
|
||||
count = 0
|
||||
for i, padid in enumerate(padids):
|
||||
print (padid, file=sys.stderr)
|
||||
if args.skip != None and i<args.skip:
|
||||
continue
|
||||
progressbar(i, numpads, padid)
|
||||
@ -184,6 +178,7 @@ def main (args):
|
||||
##########################################
|
||||
if args.nopublish and args.nopublish in text:
|
||||
# NEED TO PURGE ANY EXISTING DOCS
|
||||
print ("NOPUBLISH", file=sys.stderr)
|
||||
try_deleting((p+raw_ext,p+".raw.html",p+".diff.html",p+".meta.json"))
|
||||
continue
|
||||
|
||||
|
||||
9
setup.py
9
setup.py
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import distutils.command.install_lib
|
||||
from distutils.core import setup
|
||||
import setuptools
|
||||
# import distutils.command.install_lib
|
||||
# from distutils.core import setup
|
||||
import os
|
||||
|
||||
def find (p, d):
|
||||
@ -16,7 +17,7 @@ def find (p, d):
|
||||
# print "**", x
|
||||
return ret
|
||||
|
||||
setup(
|
||||
setuptools.setup(
|
||||
name='etherdump',
|
||||
version='0.3.0',
|
||||
author='Active Archives Contributors',
|
||||
@ -31,6 +32,6 @@ setup(
|
||||
description='Etherdump an etherpad publishing & archiving system',
|
||||
# long_description=open('README.md').read(),
|
||||
install_requires=[
|
||||
"html5lib", "jinja2"
|
||||
"html5lib", "jinja2", "python-dateutil", "requests"
|
||||
]
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user