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
24,29d23 | |
< typedef struct { | |
< PyObject_HEAD | |
< PyClassObject *in_class; /* The class object */ | |
< PyObject *in_dict; /* A dictionary */ | |
< PyObject *in_weakreflist; /* List of weak references */ | |
< } PyInstanceObject; |
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
>>> PacketList(a).jsondump("1") | |
Traceback (most recent call last): | |
File "<console>", line 1, in <module> | |
File "/Library/Python/2.7/site-packages/scapy/modules/serialize.py", line 24, in dump_packet_as_json | |
json.dump(s, file(filename,"wb"),ensure_ascii=False) | |
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 189, in dump | |
for chunk in iterable: | |
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 431, in _iterencode | |
for chunk in _iterencode_list(o, _current_indent_level): | |
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 332, in _iterencode_list |
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
691 class PcapWriter(RawPcapWriter): | |
692 def _write_header(self, pkt): | |
693 if self.linktype == None: | |
694 if type(pkt) is list or type(pkt) is tuple or isinstance(pkt,Bas | |
695 pkt = pkt[0] | |
696 try: | |
697 self.linktype = conf.l2types[pkt.__class__] | |
698 except KeyError: | |
699 warning("PcapWriter: unknown LL type for %s. Using type 1 (E | |
700 self.linktype = 1 |
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
class BaseRequestHandler(webapp2.RequestHandler): | |
def dispatch(self): | |
# Get a session store for this request. | |
self.session_store = sessions.get_store(request=self.request) | |
try: | |
# Dispatch the request. | |
webapp2.RequestHandler.dispatch(self) | |
except Exception as e: | |
logging.info(e) |
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
@classmethod | |
def get_cached_univs_info(cls): | |
""" | |
returns cached universities infomation. | |
@return: dict universities. all ["univ_name"]["key"] are defined but value can be None. | |
@rtype: dict | |
""" | |
univs_info = memcache.get("univs_info") # @UndefinedVariable | |
if univs_info is None: |
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
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') |
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
webapp2.Route('/auth/<provider>', handler='controllers.AuthHandler:_simple_auth', name='auth_login'), | |
uri_for('auth_login',None,provider='twitter') == "/auth/twitter" | |
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
{# ヘッダを情報バーにする。 #} | |
<div data-role="header" data-id="header_withLogin" data-position="fixed" id="{{page_name}}_header_withLogin"> | |
<h1>{{title}}</h1> | |
<img id="{{page_name}}_user_settings_button" class="ui-btn-left" alt="{{user.name}}の{{user.auth_provider}}の画像" src="{{user.avatar_url}}" width="32px" height="32px"> | |
<a href="#{{page_name}}_settings_popup" data-rel="popup" data-inline="true" class="ui-btn ui-shadow ui-btn-right">設定</a> | |
</div> | |
{# 上のボタンをクリックしたら開くメニューパネル。 #} | |
<div id="{{page_name}}_settings_popup" data-transition="pop" data-role="popup" class="ui-content" style="min-width:210px;"> | |
<div data-role="collapsible-set"> | |
<div data-role="collapsible"> |
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 _callback_uri_for(self, provider): | |
if (provider in secrets.AUTH_CONFIG.keys()): | |
if provider == "google": | |
return "https://paper-mobile.appspot.com/auth/google/callback" | |
return self.uri_for('main', provider=provider, _full=True) |
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
print "Hello world" |
NewerOlder