Module parpg_editor
[hide private]
[frames] | no frames]

Source Code for Module parpg_editor

 1  #!/usr/bin/env python2 
 2   
 3  #   This file is part of PARPG. 
 4  #   PARPG 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  #   PARPG 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 PARPG.  If not, see <http://www.gnu.org/licenses/>. 
16   
17  import os 
18  import sys 
19   
20  """ 
21  This runs the editor in ..\tools\map_editor\run.py 
22  """ 
23   
24  if __name__ == '__main__': 
25      parpg_path = os.path.split(os.path.realpath(sys.argv[0]))[0] 
26      parpg_dir = parpg_path.split('/')[-1] 
27   
28      args = [sys.executable, './run.py'] 
29   
30      if len(sys.argv) > 1: 
31          map_path = sys.argv[1] 
32   
33          args.append(os.path.join('..', parpg_dir, map_path)) 
34   
35      fife_editor_path = os.path.join(parpg_path, '..', 'tools', 'map_editor') 
36      os.chdir(fife_editor_path) 
37      os.execv(args[0], args) 
38