add setting.py
This commit is contained in:
parent
23555755e3
commit
9d60ed1042
4 changed files with 2447 additions and 0 deletions
105
.gitignore
vendored
Normal file
105
.gitignore
vendored
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
.hypothesis/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
.static_storage/
|
||||||
|
.media/
|
||||||
|
local_settings.py
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# celery beat schedule file
|
||||||
|
celerybeat-schedule
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
|
78
myutil.py
Executable file
78
myutil.py
Executable file
|
@ -0,0 +1,78 @@
|
||||||
|
# coding=utf8
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class MyPrettyPrinter(pprint.PrettyPrinter):
|
||||||
|
def format(self, object, context, maxlevels, level):
|
||||||
|
if six.PY2:
|
||||||
|
if isinstance(object, unicode):
|
||||||
|
return (object.encode("utf8"), True, False)
|
||||||
|
return pprint.PrettyPrinter.format(self, object, context, maxlevels, level)
|
||||||
|
|
||||||
|
|
||||||
|
def remove_space(s):
|
||||||
|
return s.replace(u" ", "").strip()
|
||||||
|
|
||||||
|
|
||||||
|
def minguo2ce(minguo):
|
||||||
|
pattern = "(\d+)\.([ 0-9]{1,2})\.([ 0-9]{1,2})"
|
||||||
|
s = re.search(pattern, minguo)
|
||||||
|
if s:
|
||||||
|
yy = int(s.group(1)) + 1911
|
||||||
|
|
||||||
|
try:
|
||||||
|
mm = int(s.group(2))
|
||||||
|
except:
|
||||||
|
mm = 1
|
||||||
|
|
||||||
|
try:
|
||||||
|
dd = int(s.group(3))
|
||||||
|
except:
|
||||||
|
dd = 1
|
||||||
|
|
||||||
|
return date(yy, mm, dd)
|
||||||
|
|
||||||
|
pattern = "(\d+)/([ 0-9]{1,2})/([ 0-9]{1,2})"
|
||||||
|
s = re.search(pattern, minguo)
|
||||||
|
if s:
|
||||||
|
yy = int(s.group(1)) + 1911
|
||||||
|
|
||||||
|
try:
|
||||||
|
mm = int(s.group(2))
|
||||||
|
except:
|
||||||
|
mm = 1
|
||||||
|
|
||||||
|
try:
|
||||||
|
dd = int(s.group(3))
|
||||||
|
except:
|
||||||
|
dd = 1
|
||||||
|
|
||||||
|
return date(yy, mm, dd)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def xstr(s):
|
||||||
|
return "" if s is None else s
|
||||||
|
|
||||||
|
|
||||||
|
def jprint(a):
|
||||||
|
import json
|
||||||
|
|
||||||
|
print(json.dumps(a, ensure_ascii=False, indent=4, sort_keys=True))
|
||||||
|
|
||||||
|
|
||||||
|
def PrintException():
|
||||||
|
exc_type, exc_obj, tb = sys.exc_info()
|
||||||
|
f = tb.tb_frame
|
||||||
|
lineno = tb.tb_lineno
|
||||||
|
filename = f.f_code.co_filename
|
||||||
|
linecache.checkcache(filename)
|
||||||
|
line = linecache.getline(filename, lineno, f.f_globals)
|
||||||
|
print(
|
||||||
|
'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(
|
||||||
|
filename, lineno, line.strip(), exc_obj
|
||||||
|
)
|
||||||
|
)
|
2239
portal_selenium.py
Executable file
2239
portal_selenium.py
Executable file
File diff suppressed because it is too large
Load diff
25
settings.py
Normal file
25
settings.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import os
|
||||||
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
|
# PROJECT_APP_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
# PROJECT_APP = os.path.basename(PROJECT_APP_PATH)
|
||||||
|
# BASE_DIR = os.path.dirname(PROJECT_APP_PATH)
|
||||||
|
|
||||||
|
# DEBUG = False
|
||||||
|
|
||||||
|
USER_ID = '123456'
|
||||||
|
PASSWORD = '123456'
|
||||||
|
|
||||||
|
##################
|
||||||
|
# LOCAL SETTINGS #
|
||||||
|
##################
|
||||||
|
|
||||||
|
# Allow any settings to be defined in local_settings.py which should be
|
||||||
|
# ignored in your version control system allowing for settings to be
|
||||||
|
# defined per machine.
|
||||||
|
|
||||||
|
from .local_settings import *
|
||||||
|
|
||||||
|
# try:
|
||||||
|
# from .local_settings import *
|
||||||
|
# except ImportError:
|
||||||
|
# pass
|
Loading…
Reference in a new issue