This is just for me - putty update script

Moderator: BarsMonster

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

This is just for me - putty update script

Post by BarsMonster » Mon Jan 31, 2011 7:22 am

Code: Select all

#Author Michail Svarychevsky 3@14.by
#Licensed under MIT license

import winreg

print ("")
print ("This is awesome Putty settings update script!")
print ("---------------------------------------------")

i = 0
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\SimonTatham\PuTTY\Sessions", 0, 15) as key:
  while 1:
    try:
      subkey = winreg.EnumKey(key, i ) 
      print ("Processing " + subkey + "...")
      with winreg.OpenKey(key, subkey, 0, 15) as session:
        winreg.SetValueEx(session, "Colour14", 0, winreg.REG_SZ, "96,96,255")
        winreg.SetValueEx(session, "Colour15", 0, winreg.REG_SZ, "150,150,255")
        winreg.SetValueEx(session, "ScrollbackLines", 0, winreg.REG_DWORD, 20000)

        winreg.SetValueEx(session, "TermHeight", 0, winreg.REG_DWORD, 40)
        winreg.SetValueEx(session, "TermWidth", 0, winreg.REG_DWORD, 150)

        winreg.SetValueEx(session, "WarnOnClose", 0, winreg.REG_DWORD, 0)
        winreg.SetValueEx(session, "Compression", 0, winreg.REG_DWORD, 1)
        winreg.SetValueEx(session, "FullScreenOnAltEnter", 0, winreg.REG_DWORD, 1)

      i+=1
    except WindowsError:
      break
  
print ("---------------------------------------------")
print ("We are done!")

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest