forked from zwczou/weixin-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
58 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ def fread(fname): | |
long_description=fread('README.md'), | ||
license='BSD', | ||
packages=find_packages(), | ||
version='0.3.0', | ||
version='0.4.0', | ||
author='zwczou', | ||
author_email='[email protected]', | ||
url='https://github.com/zwczou/weixin-python', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
from flask import current_app | ||
from .msg import WeixinMsg | ||
from .pay import WeixinPay | ||
from .login import WeixinLogin | ||
from .mp import WeixinMP | ||
from .base import WeixinError, Map | ||
|
||
from msg import WeixinMsg | ||
from pay import WeixinPay | ||
from login import WeixinLogin | ||
from mp import WeixinMP | ||
from base import WeixinError, Map | ||
from collections import namedtuple | ||
|
||
|
||
__all__ = ("Weixin") | ||
__author__ = "Weicheng Zou <[email protected]>" | ||
|
||
|
||
StandaloneApplication = namedtuple("StandaloneApplication", ["config"]) | ||
|
||
|
||
class Weixin(object): | ||
""" | ||
微信SDK | ||
:param app 如果非flask,传入字典配置,如果是flask直接传入app实例 | ||
""" | ||
def __init__(self, app=None): | ||
if app is not None: | ||
if isinstance(app, dict): | ||
app = StandaloneApplication(config=app) | ||
self.init_app(app) | ||
self.app = app | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters