Rushabh Mehta | 2886b95 | 2012-02-24 11:26:31 +0530 | [diff] [blame] | 1 | license = """ERPNext - web based ERP (http://erpnext.com) |
| 2 | Copyright (C) 2012 Web Notes Technologies Pvt Ltd |
| 3 | |
| 4 | This program is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation, either version 3 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>.""" |
| 16 | |
| 17 | license2 = """Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com) |
| 18 | |
| 19 | MIT License (MIT) |
| 20 | |
| 21 | Permission is hereby granted, free of charge, to any person obtaining a |
| 22 | copy of this software and associated documentation files (the "Software"), |
| 23 | to deal in the Software without restriction, including without limitation |
| 24 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 25 | and/or sell copies of the Software, and to permit persons to whom the |
| 26 | Software is furnished to do so, subject to the following conditions: |
| 27 | |
| 28 | The above copyright notice and this permission notice shall be included in |
| 29 | all copies or substantial portions of the Software. |
| 30 | |
| 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
| 32 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 33 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 34 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 35 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
| 36 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 37 | """ |
| 38 | |
| 39 | |
| 40 | if __name__=='__main__': |
| 41 | import os |
| 42 | clicense = '\n'.join([('# ' + l) for l in license2.split('\n')]) |
| 43 | |
| 44 | for wt in os.walk('lib/py/build/'): |
| 45 | for fname in wt[2]: |
| 46 | if fname.endswith('.py'): |
| 47 | path = os.path.join(wt[0], fname) |
| 48 | with open(path, 'r') as codefile: |
| 49 | codetxt = codefile.read() |
| 50 | |
| 51 | if codetxt.strip(): |
| 52 | with open(path, 'w') as codefile: |
| 53 | codefile.write(clicense + '\n\n' + codetxt) |
| 54 | |
| 55 | print 'updated in ' + path |