コード例 #1
0
ファイル: enabledisable.py プロジェクト: Mateo13/deviceclass
import time

from device import Device


TOR = Device('EOS', '10.52.2.222', 10031)
print(TOR.login())
print(TOR.write('set force enable'))


while True:
	print(TOR.write('set port disable ge.1.48'))
	time.sleep(5)
	print(TOR.write('set port enable ge.1.48'))
	time.sleep(5)


コード例 #2
0
        d.move(x, y)
        sleep(delay)
        reportPos()
except KeyboardInterrupt:
    moveY = False
    reportPos()
print('Y Calibrated!')

# Calibrate pen down
print('Calibrating D...')
moveD = True
try:
    while moveD:
        d.down = d.down + 1
        d.pen(d.down)
        d.write('M2 D%s' % d.down)
        sleep(delay)
        reportPos()
except KeyboardInterrupt:
    moveD = False
    reportPos()
print('D Calibrated!')

# Calibrate pen up
print('Calibrating U...')
moveU = True
try:
    d.up = d.down - 1
    while moveU:
        d.pen(d.up)
        sleep(delay)
コード例 #3
0
 def write(self, bytes, limits):
     """Write <block_size> chars"""
     Device.write(self, bytes, limits)
     self._addLine("".join(map(Device._chr, bytes)))
コード例 #4
0
ファイル: config_append.py プロジェクト: Mateo13/deviceclass
from device import Device
import time
import random



if __name__ == '__main__':
	f = open('output.log', 'w', buffering=0)
	DUT = Device('EOS', '10.52.2.222', 10022)
	DUT.write('\n')
	time.sleep(3)
	print(DUT.read_until('Username'))
	
	f.write(DUT.login())
	
	for x in range(500):
		# Sleep a random amount of time to change the timing slightly each iteration.
		sleeptime = random.randrange(30)
		print('*** Starting iteration %d with a %d second wait.***\n\n' % (x,sleeptime))
		f.write('\n\n*** Starting iteration %d  with a %d second wait.***\n\n' % (x,sleeptime))
		
		print('Clearing config.')
		DUT.clearConfig()
		# It takes about 3 minutes to come back online.
		output = DUT.read_until('Username:'******'Logging into DUT')
		output = output + DUT.login()
		f.write(output)
		time.sleep(sleeptime)
		print('Appending the config.')
コード例 #5
0
ファイル: devices.py プロジェクト: JulienPalard/mix-machine
 def write(self, bytes, limits):
     """Write <block_size> chars"""
     Device.write(self, bytes, limits)
     self._addLine( "".join(map(Device._chr, bytes)) )