This file contains hidden or 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
| <?php | |
| /** | |
| * read a cookie | |
| * | |
| * @access private | |
| * @return void | |
| */ | |
| protected function _get_cookie() | |
| { |
This file contains hidden or 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
| def session_required(session_name, redirect_url=None): | |
| """ | |
| 関数にセッションチェックを行う機能を追加する | |
| デコレータ関数 | |
| """ | |
| def outer_wrapper(func): | |
| def session_checker(*args, **kargs): | |
| if session.get(session_name) is not None: | |
| return func(*args, **kargs) | |
| else: |
This file contains hidden or 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
| # coding:utf-8 | |
| # Snapperクラス | |
| class Snapper(object): | |
| def __init__(self): | |
| self.state = 'OFF' | |
| self.hasPower = False # 電源が供給されているか | |
| self.isWorking = False # Snapperが稼働しているか | |
| self.previous = None # 前に接続しているSnapper | |
| self.follow = None # 次に接続しているSnapper |
NewerOlder