Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 12th, 2012  |  syntax: Python  |  size: 0.77 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/python
  2.  
  3. import os
  4.  
  5. # provides a way to split routes files in Play
  6. # the file "routes.list" should contain a list of the routes file names (all ending with .routes), delimited by line breaks
  7. # this file should be placed in the root directory of your Play project.
  8. # this is a naieve way to fix the problem
  9. # but could be a temporary way for us to split our routes files up based on subprojects
  10. # we already organize our single routes file this way, so it isn't really a massive change.
  11.  
  12. with open('conf/routes.list') as fileList:
  13.         stringToWrite = ''
  14.         for line in fileList:
  15.                 with open('conf/' + line + '.routes') as currentFile:
  16.                         stringToWrite += currentFile.read()
  17.        
  18. with open('conf/routes') as finalFile:
  19.         finalFile.write(stringToWrite)
  20.  
  21. os.system('play')