Skip to content

Commit

Permalink
Add clear bookmark to fix the config
Browse files Browse the repository at this point in the history
  • Loading branch information
LiMinggang committed Oct 27, 2017
1 parent b729072 commit 07a36ca
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions clearsavedbms.py
@@ -0,0 +1,28 @@
import sys, os, stat, string

if (__name__=="__main__"):
name = "madedit.cfg"
try:
fd = open(name, "r")
#fd = os.open(name,os.O_RDONLY)
data = fd.read(os.stat(name)[stat.ST_SIZE])
fd.close()
data = data.split('\n')
# Function header
newcfg = ""

for line in data:
tags = line.split('\x0b')
if len(tags) > 1:
#print tags
#print tags[0]
newcfg += tags[0] + '\n'
else:
if len(line) > 2:
newcfg += line + '\n'
#print newcfg
fd = open(name,"wb")
fd.write(newcfg)
fd.close()
except (OSError,IOError,KeyboardInterrupt):
print '** Halted **'

0 comments on commit 07a36ca

Please sign in to comment.