From a9c0219ff8599c65d1cdbf8e12bc5aef96c1df9b Mon Sep 17 00:00:00 2001 From: Cedric Porter Date: Mon, 30 Jul 2012 17:13:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8EEffect.py=E4=B8=AD=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EffectLab/Effect.py | 2 ++ setup.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/EffectLab/Effect.py b/EffectLab/Effect.py index e0b8088..a1df26f 100755 --- a/EffectLab/Effect.py +++ b/EffectLab/Effect.py @@ -14,6 +14,8 @@ import math, operator from math import sqrt, sin, cos, atan2 +VERSION = "1.0.0" + # 尝试加载C语言实现的部分 try: import EffectLabCore as core diff --git a/setup.py b/setup.py index 949e019..243a7af 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ # from distutils.core import setup, Extension +import re NAME = "EffectLab" DESCRIPTION = "Python Image Processing Effect Lab" @@ -13,8 +14,17 @@ HOMEPAGE = "http://everet.org/2012/07/effectlab.html" DOWNLOAD_URL = "https://github.com/cedricporter/EffectLab/downloads" +def find_version(filename): + for line in open(filename).readlines(): + m = re.search("VERSION\s*=\s*\"([^\"]+)\"", line) + if m: + return m.group(1) + return None + +VERSION = find_version("EffectLab/Effect.py") + setup(name = NAME, - version = '1.0', + version = VERSION, author = 'Hua Liang [Stupid ET]', author_email = 'et@everet.org', url = HOMEPAGE,