Skip to content

Commit

Permalink
项目初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiflydream committed Sep 21, 2017
0 parents commit e59b332
Show file tree
Hide file tree
Showing 22 changed files with 8,638 additions and 0 deletions.
207 changes: 207 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
# Created by .ignore support plugin (hsz.mobi)
### Windows template
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python template
# 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
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/

/.idea/
.idea
Empty file added __init__.py
Empty file.
51 changes: 51 additions & 0 deletions big_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env python
# encoding: utf-8

import sys
from collections import OrderedDict

from pyquery import PyQuery as pq
from workflow import Workflow

log = None


def get_version(url):
# 获得文档对象
doc = pq(url)
# 创建版本列表
version_dict = OrderedDict([])
tbodys = doc('.versions').find('tbody')
for tbody in tbodys.items():
trs = tbody('tr')
sm_list = []
# 转成list
v_list = list(trs.items())
# 判断是否有一个版本
is_only_one = len(v_list) == 1
for i, tr in enumerate(v_list):
if i != 0 or is_only_one:
sm_list.append(tr('a:first').text())
version_dict[tbody('tr:first').find('b').text() + '.x'] = str(sm_list)
return version_dict


def main(wf):
# 获得参数
params = wf.args[0]
# params = "http://mvnrepository.com/artifact/com.jayway.restassured/spring-mock-mvc"
# 获得project
versions = get_version(params)
for version in versions.keys():
# match = re.match(r'^http://mvnrepository.com/artifact/(.+)(/.+)$', params)
# group = match.group(1)
sm_v = str(versions[version])
wf.add_item(title=version, subtitle=sm_v, arg=params + ":-:" + sm_v, valid=True, icon='icon/version.png')

wf.send_feedback()


if __name__ == '__main__':
wf = Workflow()
log = wf.logger
sys.exit(wf.run(main))
Loading

0 comments on commit e59b332

Please sign in to comment.