From 8ad242da29b63fc8c848f1353c249d167bda3122 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Wed, 3 Jul 2013 14:08:50 +0800 Subject: [PATCH] add setup.py and re-organize files --- .gitignore | 2 + README.rst | 1 - configurations/arch_lilydjwg.ini | 204 ++++++++++++++++++ .../sample_config.ini | 0 nvchecker/__init__.py | 0 get_version.py => nvchecker/get_version.py | 0 nvchecker => nvchecker/main.py | 9 +- {lib => nvchecker}/notify.py | 0 setup.py | 23 ++ 9 files changed, 233 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 configurations/arch_lilydjwg.ini rename sample_config.ini => configurations/sample_config.ini (100%) create mode 100644 nvchecker/__init__.py rename get_version.py => nvchecker/get_version.py (100%) rename nvchecker => nvchecker/main.py (94%) mode change 100755 => 100644 rename {lib => nvchecker}/notify.py (100%) create mode 100755 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79d56d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +nvchecker.egg-info/ +versions/ diff --git a/README.rst b/README.rst index 3c1190a..26d2b05 100644 --- a/README.rst +++ b/README.rst @@ -92,4 +92,3 @@ More to come. Send me a patch or pull request if you can't wait and have written Bugs ---- * Finish writing results even on Ctrl-C or other interruption. -* ``setup.py`` script. diff --git a/configurations/arch_lilydjwg.ini b/configurations/arch_lilydjwg.ini new file mode 100644 index 0000000..40695fb --- /dev/null +++ b/configurations/arch_lilydjwg.ini @@ -0,0 +1,204 @@ +[3to2] +aur + +[android-apktool] +aur + +[android-docs] +aur + +[android-ndk] +aur + +[android-sdk] +aur + +; [aufs3-util-lily-git] + +[cgdb] +aur + +[coffee-script] +aur + +[dcron] +aur + +[dmg2img] +aur + +[dnscrypt-proxy-git] +; my aur +github = jedisct1/dnscrypt-proxy + +[elflibviewer] +aur + +[evince-nodbus] +cmd = LANG=C pacman -Si evince | grep -F Version | awk '{print $3}' + +[fcitx-lilydjwg-git] +github = fcitx/fcitx + +[google-appengine-python] +aur + +; [gvim-lily] + +[hfsprogs] +aur + +[kingsoft-office] +aur + +[latencytop] +aur + +[libsodium] +aur + +; [linux-lily] + +; [linux-lily-headers] + +[msdl] +aur + +[nautilus-dropbox] +aur + +[nodejs-jake] +aur + +[openresty-dev] +; my aur +url = http://openresty.org/ +regex = ngx_openresty-([\d.]+)\.tar\.gz\| + +[perl-data-random] +aur + +[perl-goo-canvas] +aur + +[perl-gtk2-imageview] +aur + +[perl-gtk2-unique] +aur + +[perl-mouse] +aur + +[perl-net-dropbox-api] +aur + +[perl-net-oauth] +aur + +[perl-proc-processtable] +aur + +[perl-yaml-tiny] +aur + +[perl4-corelibs] +aur + +[python-autopep8] +aur + +[python-bitstring] +aur + +[python-blist] +aur + +[python-cffi] +; my aur +url = https://pypi.python.org/pypi/cffi +regex = cffi-([\d.]+)\.tar\.gz + +[python-pycparser-git] +aur + +[python-setproctitle] +aur + +; [python-you-get-git] +; RSS'ed + +[python2-netlib-git] +aur + +[reaver-wps-svn] +aur + +[ruby-gettext] +aur + +[ruby-levenshtein] +aur + +[ruby-locale] +aur + +[ruby-maruku] +aur + +[ruby-sass] +aur + +[ruby-yard] +aur + +[shutter] +aur + +[spideroak] +aur + +[sqlite-manager] +aur + +[ssed] +; my aur +url = http://sed.sourceforge.net/grabbag/ssed/ +regex = The current version is ([\d.]+)\. +proxy = localhost:8087 + +[tp_smapi-dkms] +aur + +[ttf-ume] +aur + +[urlview] +aur + +; [vim-lily] + +[wdiff] +aur + +[wireshark-gtk2] +cmd = LANG=C pacman -Si wireshark-gtk | grep -F Version | awk '{print $3}' + +[xf86-input-wizardpen] +aur + +[xkbset] +aur + +[xmind] +aur + +[zbar] +aur + +; [zhcon] +; my aur +; last update is six years ago + +[zint] +aur diff --git a/sample_config.ini b/configurations/sample_config.ini similarity index 100% rename from sample_config.ini rename to configurations/sample_config.ini diff --git a/nvchecker/__init__.py b/nvchecker/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/get_version.py b/nvchecker/get_version.py similarity index 100% rename from get_version.py rename to nvchecker/get_version.py diff --git a/nvchecker b/nvchecker/main.py old mode 100755 new mode 100644 similarity index 94% rename from nvchecker rename to nvchecker/main.py index 563f8c5..f550896 --- a/nvchecker +++ b/nvchecker/main.py @@ -6,14 +6,13 @@ import sys import configparser import logging from functools import partial -sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')) from pkg_resources import parse_version from tornado.ioloop import IOLoop from tornado.options import parse_command_line, define, options -from get_version import get_version -import notify +from nvchecker.get_version import get_version +from nvchecker import notify logger = logging.getLogger(__name__) notifications = [] @@ -91,7 +90,7 @@ def get_versions(config): get_version(name, config[name], print_version_update) task_dec() -def test(): +def main(): files = parse_command_line() if not files: return @@ -108,4 +107,4 @@ def test(): ioloop.start() if __name__ == '__main__': - test() + main() diff --git a/lib/notify.py b/nvchecker/notify.py similarity index 100% rename from lib/notify.py rename to nvchecker/notify.py diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..8c57ea4 --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +# vim:fileencoding=utf-8 + +from setuptools import setup, find_packages + +setup( + name = 'nvchecker', + version = '0.1', + packages = find_packages(), + install_requires = ['tornado'], + entry_points = { + 'console_scripts': [ + 'nvchecker = nvchecker.main:main', + ], + }, + + author = 'lilydjwg', + author_email = 'lilydjwg@gmail.com', + description = 'New version checker for software', + license = 'MIT', + keywords = 'new version build check', + url = 'https://github.com/lilydjwg/nvchecker', +)