Compare commits

...

6 Commits

Author SHA1 Message Date
Bob Lantz 0f15744cc9 Remove mnexec build and copy from make install, and add make develop. 2012-03-13 16:30:40 -07:00
Bob Lantz a0497d8c38 Change setup.py metadata to reflect BSD license. 2012-03-13 16:26:09 -07:00
Ed Swierk 2e4ef57cf0 Include mnexec.c in the Python sdist package, and compile mnexec
when building the package
2012-03-13 16:25:15 -07:00
Brandon Heller 99222e70f7 Merge pull request #26 from mininet/devel/install-oneiric
Devel/install oneiric
2012-03-13 15:11:29 -07:00
Bob Lantz 5562e66a2d Ignore build, dist and emacs backup~ files. 2012-03-12 16:14:00 -07:00
Bob Lantz 28f46c8d2d Pass code check. 2012-03-12 16:12:38 -07:00
8 changed files with 45 additions and 26 deletions
+3
View File
@@ -1,3 +1,6 @@
mnexec
*.pyc
*~
mininet.egg-info
build
dist
+1 -1
View File
@@ -53,7 +53,7 @@ disable-msg-cat=IR
#enable-msg=
# Disable the message(s) with the given id(s).
disable-msg=W0704,C0103,W0231,E1102,W0511,W0142,R0902,R0903,R0904,R0913,R0914,R0801
disable=W0704,C0103,W0231,E1102,W0511,W0142,R0902,R0903,R0904,R0913,R0914,R0801,I0011
[REPORTS]
+2
View File
@@ -0,0 +1,2 @@
include mnexec.c
exclude bin/mnexec
+4 -2
View File
@@ -21,10 +21,12 @@ test: $(MININET) $(TEST)
-echo "Running tests"
mininet/test/test_nets.py
install: mnexec
cp mnexec bin/
install:
python setup.py install
develop:
python setup.py develop
doc:
doxygen doxygen.cfg
+1 -1
View File
@@ -602,7 +602,7 @@ class MiniEdit( Frame ):
cleanUpScreens()
self.net = None
def xterm( self, ignore=None ):
def xterm( self, _ignore=None ):
"Make an xterm when a button is pressed."
if ( self.selection is None or
self.net is None or
+7 -7
View File
@@ -116,19 +116,19 @@ class Node( object ):
self.shell = None
# Subshell I/O, commands and control
def read( self, bytes=1024 ):
def read( self, maxbytes=1024 ):
"""Buffered read from node, non-blocking.
bytes: maximum number of bytes to return"""
maxbytes: maximum number of bytes to return"""
count = len( self.readbuf )
if count < bytes:
data = os.read( self.stdout.fileno(), bytes - count )
if count < maxbytes:
data = os.read( self.stdout.fileno(), maxbytes - count )
self.readbuf += data
if bytes >= len( self.readbuf ):
if maxbytes >= len( self.readbuf ):
result = self.readbuf
self.readbuf = ''
else:
result = self.readbuf[ :bytes ]
self.readbuf = self.readbuf[ bytes: ]
result = self.readbuf[ :maxbytes ]
self.readbuf = self.readbuf[ maxbytes: ]
return result
def readline( self ):
+3 -3
View File
@@ -136,13 +136,13 @@ def createLink( node1, node2, port1=None, port2=None ):
# IP and Mac address formatting and parsing
def _colonHex( val, bytes ):
def _colonHex( val, count ):
"""Generate colon-hex string.
val: input as unsigned int
bytes: number of bytes to convert
count: number of bytes to convert
returns: chStr colon-hex string"""
pieces = []
for i in range( bytes - 1, -1, -1 ):
for i in range( count - 1, -1, -1 ):
piece = ( ( 0xff << ( i * 8 ) ) & val ) >> ( i * 8 )
pieces.append( '%02x' % piece )
chStr = ':'.join( pieces )
+24 -12
View File
@@ -2,26 +2,33 @@
"Setuptools params"
from setuptools import setup, find_packages
from os.path import join
scripts = [ join( 'bin', filename ) for filename in [
'mn', 'mnexec' ] ]
import os, setuptools
import distutils.command.build_scripts
import distutils.command.clean
import distutils.ccompiler
modname = distname = 'mininet'
setup(
class build_scripts(distutils.command.build_scripts.build_scripts):
def run(self):
distutils.ccompiler.new_compiler().link_executable(["mnexec.c"], "bin/mnexec")
distutils.command.build_scripts.build_scripts.run(self)
class clean(distutils.command.clean.clean):
def run(self):
if os.path.exists("bin/mnexec"):
os.unlink("bin/mnexec")
distutils.command.clean.clean.run(self)
setuptools.setup(
name=distname,
version='0.0.0',
description='Process-based OpenFlow emulator',
author='Bob Lantz',
author_email='rlantz@cs.stanford.edu',
packages=find_packages(exclude='test'),
long_description="""
Insert longer description here.
""",
packages=setuptools.find_packages(exclude='test'),
classifiers=[
"License :: OSI Approved :: GNU General Public License (GPL)",
"License :: OSI Approved :: BSD",
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
@@ -33,5 +40,10 @@ Insert longer description here.
'setuptools',
'networkx'
],
scripts=scripts,
scripts=[
'bin/mn',
'bin/mnexec'
],
cmdclass={"build_scripts": build_scripts,
"clean": clean}
)