new setup and print message on nopublish
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user