Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
games
krank
krank-0.7-yaml.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File krank-0.7-yaml.patch of Package krank
diff -ur src/Config.py /usr/lib/krank/Config.py --- src/Config.py 2009-03-13 14:20:29.000000000 +0300 +++ /usr/lib/krank/Config.py 2009-03-13 14:44:58.000000000 +0300 @@ -1,6 +1,7 @@ # # Config.py +import yaml import getopt, sys import k, levels @@ -132,10 +133,16 @@ self['fullscreen'] = k.config.fullscreen try: config_file = self.getConfigFilePath() + if os.access(config_file, os.R_OK|os.W_OK): + os.unlink(config_file) + print "Old config file has been converted in yaml format" + print "\tnew config name is ", config_file+'.yaml' + config_file += '.yaml' log('writing config to', config_file, log='config') log(self, log='config') file = open(config_file, 'w+') - cPickle.dump(self, file) + file.write("# vim: filetype=yaml :\n") + yaml.dump(self, file) except Exception, e: log(e) @@ -145,8 +152,16 @@ config_file = self.getConfigFilePath() log('reading config from', config_file, log='config') log(self, log='config') - file = open(config_file, 'r') - self.update(cPickle.load(file)) + yaml_type=0 + + if not os.access(config_file, os.R_OK): + config_file += '.yaml' + file = open(config_file, 'r') + self.update(yaml.load(file)) + else: + file = open(config_file, 'r') + self.update(cPickle.load(file)) + self.stage = self['stage'] k.config.fullscreen=self['fullscreen'] while len(self['scores']) < 4: self['scores'].append([])
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor