fix some errors on 2.6

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-11-09 03:34:40 +00:00
parent 9b18e28ff7
commit 756a3e6dd4
2 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import codecs, datetime, grp, md5, os, pwd, re, shutil, stat, string
import codecs, datetime, grp, hashlib, os, pwd, re, shutil, stat, string
import fcntl, select, pty, threading
import aes, dirutil, regex, highlight, lex, term
from point import Point
@ -581,7 +581,8 @@ class FileBuffer(Buffer):
def path_exists(self):
return os.path.exists(self.path)
def store_checksum(self, data):
self.checksum = md5.new(data)
#self.checksum = md5.new(data)
self.checksum = hashlib.md5(data)
def read(self):
if self.path_exists():
f = self._open_file_r()
@ -618,7 +619,8 @@ class FileBuffer(Buffer):
f = open(self.path)
data = f.read()
f.close()
m = md5.new(data)
#m = md5.new(data)
m = hashlib.md5(data)
return self.checksum.digest() != m.digest()
def save(self, force=False):
if self.readonly():

5
tab.py
View File

@ -1,6 +1,5 @@
import regex, util
from point import Point
from sets import Set
class Marker(object):
def __init__(self, name, level):
@ -241,8 +240,8 @@ class Marker2(object):
class StackTabber2(Tabber):
open_tokens = {'delimiter': {'{': '}', '(': ')', '[': ']'}}
close_tokens = {'delimiter': {'}': '{', ')': '(', ']': '['}}
scope_tokens = {'delimiter': Set(['{'])}
control_tokens = {'keyword': Set(['if', 'else', 'while', 'do', 'for'])}
scope_tokens = {'delimiter': set(['{'])}
control_tokens = {'keyword': set(['if', 'else', 'while', 'do', 'for'])}
end_at_eof = True
end_at_tokens = {}
continue_tokens = {}