Advertisement
clockworkpc

PolyTanks Python Script

Mar 6th, 2012
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.20 KB | None | 0 0
  1. #!/usr/bin/python
  2. #/home/macbuntu/bin/polytanks.py
  3.  
  4. # Released under a GPLv3 Licence by Clockwork PC 2011
  5. # www.clockworkpc.com.au
  6.  
  7. # You are entitled to the following four freedoms:
  8. # Freedom 0: To run this program for any purpose
  9. # Freedom 1: To study how this program works and change it to make it do what you wish
  10. # Freedom 2: To redistribute copies so you can help your neighbour
  11. # Freedom 3: To distribute copies of your modified version to others
  12.  
  13. import os
  14.  
  15. folder = os.getenv("HOME")+"/Documents/RTM_Jobs/PolyTankAdjust/"
  16. tankName = raw_input("What is the item code? ")
  17. tankFile = folder + tankName + ".txt"
  18.  
  19. print tankName
  20. print ""
  21.  
  22. introLine = "Code for"
  23. smartAdd = "list:it-alex !2 #@ostendo,watertanks"
  24.  
  25. codeBeige = "-BG"
  26. codeBlack = "-BK"
  27. codeBronze = "-BO"
  28. codeHeritageGreen = "-HG"
  29. codeHeritageRed = "-HR"
  30. codeJasper = "-JA"
  31. codeMerino = "-ME"
  32. codeMistGreen = "-MG"
  33. codeMountainBlue = "-MB"
  34. codeRiverGum = "-RG"
  35. codeSlateGrey = "-SG"
  36. codeSmoothCream = "-SC"
  37. codeSurfMist = "-SM"
  38. codeWheat = "-WH"
  39.  
  40. colourBeige = "Beige"
  41. colourBlack = "Black"
  42. colourBronze = "Bronze"
  43. colourHeritageGreen = "HeritageGreen"
  44. colourHeritageRed = "HeritageRed"
  45. colourJasper = "Jasper"
  46. colourMerino = "Merino"
  47. colourMistGreen = "MistGreen"
  48. colourMountainBlue = "MountainBlue"
  49. colourRiverGum = "RiverGum"
  50. colourSlateGrey = "SlateGrey"
  51. colourSmoothCream = "SmoothCream"
  52. colourSurfMist = "SurfMist"
  53. colourWheat = "Wheat"
  54.  
  55. tankListBeige = introLine+" "+tankName+codeBeige+" "+smartAdd
  56. tankListBlack = introLine+" "+tankName+codeBlack+" "+smartAdd
  57. tankListBronze = introLine+" "+tankName+codeBronze+" "+smartAdd
  58. tankListHeritageGreen = introLine+" "+tankName+codeHeritageGreen+" "+smartAdd
  59. tankListHeritageRed = introLine+" "+tankName+codeHeritageRed+" "+smartAdd
  60. tankListJasper = introLine+" "+tankName+codeJasper+" "+smartAdd
  61. tankListMountainBlue = introLine+" "+tankName+codeMountainBlue+" "+smartAdd
  62. tankListMerino = introLine+" "+tankName+codeMerino+" "+smartAdd
  63. tankListMistGreen = introLine+" "+tankName+codeMistGreen+" "+smartAdd
  64. tankListRiverGum = introLine+" "+tankName+codeRiverGum+" "+smartAdd
  65. tankListSmoothCream = introLine+" "+tankName+codeSmoothCream+" "+smartAdd
  66. tankListSlateGrey = introLine+" "+tankName+codeSlateGrey+" "+smartAdd
  67. tankListSurfMist = introLine+" "+tankName+codeSurfMist+" "+smartAdd
  68. tankListWheat = introLine+" "+tankName+codeWheat+" "+smartAdd
  69.  
  70. #printtankListBeige
  71. #printtankListBlack
  72. #printtankListBronze
  73. #printtankListHeritageGreen
  74. #printtankListHeritageRed
  75. #printtankListJasper
  76. #printtankListMountainBlue
  77. #printtankListMerino
  78. #printtankListMistGreen
  79. #printtankListRiverGum
  80. #printtankListSmoothCream
  81. #printtankListSlateGrey
  82. #printtankListSurfMist
  83. #printtankListWheat
  84.  
  85. tankListTotal = """
  86. """+tankListBeige+"""
  87. """+tankListBlack+"""
  88. """+tankListBronze+"""
  89. """+tankListHeritageGreen+"""
  90. """+tankListHeritageRed+"""
  91. """+tankListJasper+"""
  92. """+tankListMountainBlue+"""
  93. """+tankListMerino+"""
  94. """+tankListMistGreen+"""
  95. """+tankListRiverGum+"""
  96. """+tankListSmoothCream+"""
  97. """+tankListSlateGrey+"""
  98. """+tankListSurfMist+"""
  99. """+tankListWheat
  100.  
  101. print tankListTotal
  102.  
  103. os.system("touch " + tankFile)
  104.  
  105. f=open(tankFile,"a")
  106.  
  107. f.write(tankListTotal)
  108.  
  109. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement