comparison upmana/validate.py @ 135:dcf4fbe09b70 beta

Traipse Beta 'OpenRPG' {091010-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Beta) Added Bookmarks Fix to Remote Admin Commands Minor fix to text based Server Fix to Pretty Print, from Core Fix to Splitter Nodes not being created Fix to massive amounts of images loading, from Core Added 'boot' command to remote admin Added confirmation window for sent nodes Minor changes to allow for portability to an OpenSUSE linux OS Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG Zoom Mouse plugin added Images added to Plugin UI Switching to Element Tree Map efficiency, from FlexiRPG Added Status Bar to Update Manager default_manifest.xml renamed to default_upmana.xml Cleaner clode for saved repositories New TrueDebug Class in orpg_log (See documentation for usage) Mercurial's hgweb folder is ported to upmana **Pretty important update that can help remove thousands of dead children from your gametree. **Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check your gametree and look for dead children!! **New Gamtree Recusion method, mapping, and context sensitivity. !!Alpha - Watch out for infinite loops!!
author sirebral
date Tue, 10 Nov 2009 14:11:28 -0600
parents 65c212e9a5b4
children dcae32e219f1
comparison
equal deleted inserted replaced
101:394ebb3b6a0f 135:dcf4fbe09b70
10 import os 10 import os
11 11
12 class Validate: 12 class Validate:
13 def __init__(self, userpath=None): 13 def __init__(self, userpath=None):
14 if userpath is None: 14 if userpath is None:
15 userpath = dir_struct["home"] + os.sep + 'upmana' +os.sep 15 userpath = dir_struct["home"] + os.sep + 'upmana' + os.sep
16 self.__loadUserPath = userpath 16 self.__loadUserPath = userpath
17 17
18 def config_file(self, user_file, template_file): 18 def config_file(self, user_file, template_file):
19 #STEP 1: verify the template exists 19 #STEP 1: verify the template exists
20 if (not os.path.exists(dir_struct["template"] + template_file)): 20 if (not os.path.exists(self.__loadUserPath + template_file)):
21 return 0 21 return 0
22 22
23 #STEP 2: verify the user file exists. If it doesn't then create it from template 23 #STEP 2: verify the user file exists. If it doesn't then create it from template
24 if (not os.path.exists(self.__loadUserPath + user_file)): 24 if (not os.path.exists(self.__loadUserPath + user_file)):
25 default = open(dir_struct["template"] + template_file,"r") 25 default = open(self.__loadUserPath + template_file,"r")
26 file = default.read() 26 file = default.read()
27 newfile = open(self.__loadUserPath + user_file,"w") 27 newfile = open(self.__loadUserPath + user_file,"w")
28 newfile.write(file) 28 newfile.write(file)
29 default.close() 29 default.close()
30 newfile.close() 30 newfile.close()