コード例 #1
0
ファイル: iface.py プロジェクト: gynvael/iface
import socket
import StringIO
import struct
import subprocess
import sys
import time
import threading
if sys.platform != 'win32':
  import fcntl
from ifaceconfiglib import cfg

# -------------------------------------------------------------------
# CONFIGURATION (set values from config file)
# -------------------------------------------------------------------

SECRET = cfg.get('main', 'secret')
HOME_PATH_ON_VM = cfg.get('main', 'home_path')
BIND_PORT = cfg.getInt('main', 'bind_port')
TERMINAL_CMD = cfg.get('main', 'terminal_cmd')
REMOTE_IP_LIST = eval(cfg.get('main', 'remote_ip_list'))

CMDS={
    "iface-info"    : "CMD_iface_info", # Returns some info.
    "iface-ping"    : "CMD_ping",       # Returns "pong"
    "iface-openurl" : "CMD_openurl",    # Opens http or https url.
    "iface-l-cmd"   : "CMD_l_cmd",      # Spawns a linux console.
    "translate-path": "CMD_translate_path", # Translates path.
    }

LOG_LEVEL = LOG_DEBUG
# -------------------------------------------------------------------
コード例 #2
0
import sys
import threading
from ifaceconfiglib import cfg 

# Constants for debug level in CONFIGURATION section.
LOG_ERROR   =  0
LOG_WARNING =  1
LOG_INFO    =  3
LOG_VERBOSE =  5
LOG_DEBUG   = 10

# -------------------------------------------------------------------
# CONFIGURATION (set values from config file)
# -------------------------------------------------------------------

SECRET = cfg.get('main', 'secret')
BIND_PORT = cfg.getInt('main', 'bind_port')
 
LOG_LEVEL = LOG_INFO

# -------------------------------------------------------------------
# End of constants / configs.
# -------------------------------------------------------------------

if len(SECRET) == 0:
  print "This is your time running Windows/Linux iface. You first need to set "
  print "some things up before you can use it."
  print "Please open iface.cfg and set needed values."
  sys.exit(1)

# -------------------------------------------------------------------
コード例 #3
0
ファイル: iface.py プロジェクト: wrobeljakub/win-linux-setup
import socket
import StringIO
import struct
import subprocess
import sys
import time
import threading
if sys.platform != 'win32':
    import fcntl
from ifaceconfiglib import cfg

# -------------------------------------------------------------------
# CONFIGURATION (set values from config file)
# -------------------------------------------------------------------

SECRET = cfg.get('main', 'secret')
HOME_PATH_ON_VM = cfg.get('main', 'home_path')
BIND_PORT = cfg.getInt('main', 'bind_port')
TERMINAL_CMD = cfg.get('main', 'terminal_cmd')
REMOTE_IP_LIST = eval(cfg.get('main', 'remote_ip_list'))

CMDS = {
    "iface-info": "CMD_iface_info",  # Returns some info.
    "iface-ping": "CMD_ping",  # Returns "pong"
    "iface-openurl": "CMD_openurl",  # Opens http or https url.
    "iface-l-cmd": "CMD_l_cmd",  # Spawns a linux console.
    "translate-path": "CMD_translate_path",  # Translates path.
}

LOG_LEVEL = LOG_DEBUG
# -------------------------------------------------------------------
コード例 #4
0
ファイル: ifaceclientlib.py プロジェクト: gynvael/iface
import sys
import threading
from ifaceconfiglib import cfg 

# Constants for debug level in CONFIGURATION section.
LOG_ERROR   =  0
LOG_WARNING =  1
LOG_INFO    =  3
LOG_VERBOSE =  5
LOG_DEBUG   = 10

# -------------------------------------------------------------------
# CONFIGURATION (set values from config file)
# -------------------------------------------------------------------

SECRET = cfg.get('main', 'secret')
BIND_PORT = cfg.getInt('main', 'bind_port')
 
LOG_LEVEL = LOG_DEBUG

# -------------------------------------------------------------------
# End of constants / configs.
# -------------------------------------------------------------------

if len(SECRET) == 0:
  print "This is your time running Windows/Linux iface. You first need to set "
  print "some things up before you can use it."
  print "Please open iface.cfg and set needed values."
  sys.exit(1)

# -------------------------------------------------------------------
コード例 #5
0
ファイル: if-l-cmd.py プロジェクト: mark-ulrich/iface
#!/usr/bin/python
#
# LICENSE: See LICENSE file.
#
# WARNING: The Windows/Linux iface by is EXPERIMENTAL and has nothing to do
#          with good coding, security, etc. USE AT YOUR OWN RISK.
#
import ifaceclientlib, sys
from ifaceconfiglib import cfg
ifaceclientlib.LOG_LEVEL = ifaceclientlib.LOG_WARNING

# Check args.
if len(sys.argv) > 2:
    print "usage: if-l-cmd.py <cwd>"
    sys.exit(1)
elif len(sys.argv) == 2:
    cwd = sys.argv[1]
else:
    cwd = cfg.get('main', 'home_path')

# Invoke.
print ifaceclientlib.Invoke("iface-l-cmd", cwd)