Commit ba374b33 authored by liuzheng712's avatar liuzheng712

style: use python3 at the head of file

parent fe7bcb81
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from .app import Coco
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import datetime
import os
import time
......@@ -302,4 +306,4 @@ class Coco:
"asset": session.server.asset.hostname,
"system_user": session.server.system_user.username,
"timestamp": int(time.time())
})
\ No newline at end of file
})
#!coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
BACKSPACE_CHAR = {b'\x08': b'\x08\x1b[K', b'\x7f': b'\x08\x1b[K'}
ENTER_CHAR = [b'\r', b'\n', b'\r\n']
......
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
......@@ -78,4 +78,4 @@ elif is_py3:
builtin_str = str
bytes = bytes
str = str
\ No newline at end of file
str = str
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""
coco.config
~~~~~~~~~~~~
......
# coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
class PermissionFailed(Exception):
......
# coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import socket
import threading
import logging
......
# coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import socket
import json
import logging
......@@ -14,7 +17,6 @@ from jms.models import User
from .models import Request, Client, WSProxy
from .interactive import InteractiveServer
logger = logging.getLogger(__file__)
......
#!coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import logging
import socket
import threading
......
#!coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import logging
import paramiko
......
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import threading
import datetime
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
......@@ -80,7 +81,7 @@ class ServerReplayRecorder(ReplayRecorder):
:return:
"""
# Todo: <liuzheng712@gmail.com>
super().record_replay(data_set)
# super().record_replay(data_set)
def session_start(self, session_id):
print("When session {} start exec".format(session_id))
......@@ -94,7 +95,7 @@ class ServerCommandRecorder(CommandRecorder):
def record_command(self, data_set):
if not data_set:
return True
super().record_command(data_set)
# super().record_command(data_set)
return self.app.service.push_session_command(data_set)
def session_start(self, session_id):
......
#!coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import threading
import uuid
......
#! coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import os
import logging
......
#!coding: utf-8
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from __future__ import unicode_literals
......@@ -193,7 +195,8 @@ def is_obj_attr_has(obj, val, attrs=("hostname", "ip", "comment")):
if not attrs:
vals = [val for val in obj.__dict__.values() if isinstance(val, (str, int))]
else:
vals = [getattr(obj, attr) for attr in attrs if hasattr(obj, attr) and isinstance(hasattr(obj, attr), (str, int))]
vals = [getattr(obj, attr) for attr in attrs if
hasattr(obj, attr) and isinstance(hasattr(obj, attr), (str, int))]
for v in vals:
if str(v).find(val) != -1:
......@@ -363,5 +366,4 @@ def compile_message():
pass
ugettext = _gettext()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import os
BASE_DIR = os.path.dirname(__file__)
......
#!/usr/bin/python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import os
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment