• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(10)  |  Call(0)  |  Derive(0)  |  Import(10)
int(x[, base]) -> integer

Convert a string or number to an integer, if possible.  A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!)  When converting a string, use
the optional base.  It is an error to supply a base when converting a
non-string.  If base is zero, the proper base is guessed based on the
string content.  If the argument is outside the integer range a
long object will be returned instead.

src/b/r/braintree_python_examples-HEAD/tr_checkout_app_engine/web/wsgiserver/__init__.py   braintree_python_examples(Download)
            try: os.chmod(self.bind_addr, 0777)
            except: pass
 
            info = [(socket.AF_UNIX, socket.SOCK_STREAM, 0, "", self.bind_addr)]
        else:
            # AF_INET or AF_INET6 socket
            # Get the correct address family for our host (allows IPv6 addresses)

src/d/j/django-navbar-0.3.0/examples/dbgp/_logging/handlers.py   django-navbar(Download)
    def _connect_unixsocket(self, address):
        self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
        # syslog may require either DGRAM or STREAM sockets
        try:
            self.socket.connect(address)
        except socket.error:
            self.socket.close()
            self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

src/p/y/pylibssh2-HEAD/examples/ssh_x11.py   pylibssh2(Download)
import os
import select, sys
import subprocess
from socket import socket, AF_INET, AF_UNIX, SOCK_STREAM, SHUT_RDWR
import tty, termios
 
import libssh2
def x11_callback(session, channel, shost, sport, abstract):
    display = os.environ["DISPLAY"]
    display_port = display[display.index(":")+1]
    _path_unix_x = "/tmp/.X11-unix/X%s" % display_port
    if display[:5] == "unix:" or display[0] == ':':
        x11_sock = socket(AF_UNIX, SOCK_STREAM)
        x11_sock.connect(_path_unix_x)

src/p/y/pylibssh2-1.0.0/examples/ssh_x11.py   pylibssh2(Download)
import fcntl
import os
import select, signal, struct, sys
from socket import socket, AF_INET, AF_UNIX, SOCK_STREAM, SHUT_RDWR
import tty, termios
 
import libssh2
def x11_callback(session, channel, shost, sport, abstract):
    display = os.environ["DISPLAY"]
    display_port = display[display.index(":")+1]
    _path_unix_x = "/tmp/.X11-unix/X%s" % display_port
    if display[:5] == "unix:" or display[0] == ':':
        x11_sock = socket(AF_UNIX, SOCK_STREAM)
        x11_sock.connect(_path_unix_x)

src/g/r/grailbrowser-HEAD/src/SampleGrailDir/user/rcgrail.py   grailbrowser(Download)
    cmd = cmd + ' ' + uri
    # now do the remote connection and command
    try:
        s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
        s.connect(filename)
        s.send(cmd)
        if pingonly:

src/t/e/telepathy-python-HEAD/examples/file-transfer.py   telepathy-python(Download)
    def ft_state_changed_cb(self, state, reason):
        FTClient.ft_state_changed_cb(self, state, reason)
 
        if state == FILE_TRANSFER_STATE_OPEN:
            s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
            s.connect(self.sock_addr)
 
    def ft_state_changed_cb(self, state, reason):
        FTClient.ft_state_changed_cb(self, state, reason)
 
        if state == FILE_TRANSFER_STATE_OPEN:
            # receive file
            s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
            s.connect(self.sock_addr)

src/p/e/pexpect-HEAD/pexpect/examples/bd_serv.py   pexpect(Download)
    virtual_screen.write (child.after)
 
    if os.path.exists("/tmp/mysock"): os.remove("/tmp/mysock")
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    localhost = '127.0.0.1'
    s.bind('/tmp/mysock')
    os.chmod('/tmp/mysock',0777)

src/p/e/pexpect-HEAD/pexpect/examples/bd_client.py   pexpect(Download)
 
#HOST = '' #'localhost'    # The remote host
#PORT = 1664 # The same port as used by the server
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect(sys.argv[1])#(HOST, PORT))
time.sleep(1)
#s.setblocking(0)

src/p/e/pexpect-HEAD/examples/bd_client.py   pexpect(Download)
 
#HOST = '' #'localhost'    # The remote host
#PORT = 1664 # The same port as used by the server
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect(sys.argv[1])#(HOST, PORT))
time.sleep(1)
#s.setblocking(0)

src/p/e/pexpect-2.4/examples/bd_serv.py   pexpect(Download)
    virtual_screen.write (child.after)
 
    if os.path.exists("/tmp/mysock"): os.remove("/tmp/mysock")
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    localhost = '127.0.0.1'
    s.bind('/tmp/mysock')
    os.chmod('/tmp/mysock',0777)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next