Rushabh Mehta 14 роки тому
джерело
коміт
5d1a9965a3
3 змінених файлів з 8 додано та 8 видалено
  1. +4
    -4
      cgi-bin/webnotes/tests.py
  2. +3
    -3
      cgi-bin/webnotes/utils/__init__.py
  3. +1
    -1
      cgi-bin/webnotes/utils/webservice.py

+ 4
- 4
cgi-bin/webnotes/tests.py Переглянути файл

@@ -26,16 +26,16 @@ if webnotes.defs.__dict__.get('modules_path'):

def get_tests():
"""
Returns list of test modules identified by "tests.py"
Returns list of test modules identified by "test*.py"
"""
ret = []
for walk_tuple in os.walk(webnotes.defs.modules_path):
if 'tests.py' in walk_tuple[2]:
for test_file in filter(lambda x: x.startswith('test') and x.endswith('.py'), walk_tuple[2]):
dir_path = os.path.relpath(walk_tuple[0], webnotes.defs.modules_path)
if dir_path=='.':
ret.append('tests')
ret.append(test_file[:-3])
else:
ret.append(dir_path.replace('/', '.') + '.tests')
ret.append(dir_path.replace('/', '.') + '.' + test_file[:-3])
return ret



+ 3
- 3
cgi-bin/webnotes/utils/__init__.py Переглянути файл

@@ -43,10 +43,10 @@ def sendmail(recipients, sender='', msg='', subject='[No Subject]', parts=[], cc
def generate_hash():
"""
Generates reandom hash for session id
Generates random hash for session id
"""
import sha, time
return sha.new(str(time.time())).hexdigest()
import hashlib, time
return hashlib.sha224(str(time.time())).hexdigest()

def db_exists(dt, dn):
return webnotes.conn.sql('select name from `tab%s` where name="%s"' % (dt, dn))


+ 1
- 1
cgi-bin/webnotes/utils/webservice.py Переглянути файл

@@ -103,7 +103,7 @@ class FrameworkServer:
# -----------------------------------------------------------------------------------------
def run_method(self, method, args):
def run_method(self, method, args={}):
res = self.http_get_response(method, args)
ret = eval(res.read())
if ret.get('exc'):


Завантаження…
Відмінити
Зберегти