Fixes in regular expressions
This commit is contained in:
parent
c5ed70e5ca
commit
f4199d5ad3
4 changed files with 15 additions and 13 deletions
|
|
@ -41,7 +41,7 @@ def start():
|
||||||
|
|
||||||
parser.add_argument('--symlink', help='Set if create direct symlink to paramecio in new site', action='store_true')
|
parser.add_argument('--symlink', help='Set if create direct symlink to paramecio in new site', action='store_true')
|
||||||
|
|
||||||
parser.add_argument('--tests', help='Create a symlink to tests for check into paramecio site', action='store_true')
|
#parser.add_argument('--tests', help='Create a symlink to tests for check into paramecio site', action='store_true')
|
||||||
|
|
||||||
# Options for deploy
|
# Options for deploy
|
||||||
|
|
||||||
|
|
@ -49,9 +49,9 @@ def start():
|
||||||
|
|
||||||
parser.add_argument('--folder', help='If you deploy in a subdirectory, set it, without beggining and ending slashes', required=False)
|
parser.add_argument('--folder', help='If you deploy in a subdirectory, set it, without beggining and ending slashes', required=False)
|
||||||
|
|
||||||
parser.add_argument('--host', help='The host ip or domain where the app is binded', required=False)
|
#parser.add_argument('--host', help='The host ip or domain where the app is binded', required=False)
|
||||||
|
|
||||||
parser.add_argument('--port', help='Change the default port 8080 to other number. Use 80 is not recommended, use 80 for the proxy server how nginx or apache', required=False)
|
#parser.add_argument('--port', help='Change the default port 8080 to other number. Use 80 is not recommended, use 80 for the proxy server how nginx or apache', required=False)
|
||||||
|
|
||||||
args=parser.parse_args()
|
args=parser.parse_args()
|
||||||
|
|
||||||
|
|
@ -106,13 +106,15 @@ def start():
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print('Error: cannot symlink paramecio in new site')
|
print('Error: cannot symlink paramecio in new site')
|
||||||
|
|
||||||
|
"""
|
||||||
if args.tests==True:
|
if args.tests==True:
|
||||||
try:
|
try:
|
||||||
os.symlink(workdir, args.path+'/paramecio2/', True)
|
os.symlink(workdir, args.path+'/paramecio2/', True)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print('Error: cannot symlink paramecio2 in new site')
|
print('Error: cannot symlink paramecio2 in new site')
|
||||||
|
"""
|
||||||
|
|
||||||
with open(path_settings+'/config.py', 'r') as f:
|
with open(path_settings+'/config.py', 'r') as f:
|
||||||
conf=f.read()
|
conf=f.read()
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,12 @@ except:
|
||||||
"""Command line utility for extract I18n.lang strings from html templates and .py files
|
"""Command line utility for extract I18n.lang strings from html templates and .py files
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pattern=re.compile('^\w+\.(py|html|phtml|js)$')
|
pattern=re.compile(r'^\w+\.(py|html|phtml|js)$')
|
||||||
|
|
||||||
ignored=re.compile('^[__|\.].*$')
|
ignored=re.compile(r'^[__|\.].*$')
|
||||||
|
|
||||||
lang_p=re.compile("I18n\.lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)")
|
lang_p=re.compile(r"I18n\.lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||||
lang_t=re.compile("\${lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
lang_t=re.compile(r"\${lang\('(.*?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
||||||
|
|
||||||
tmp_lang={}
|
tmp_lang={}
|
||||||
|
|
||||||
|
|
@ -76,9 +76,9 @@ def start():
|
||||||
|
|
||||||
module_base=os.path.basename(args.module)
|
module_base=os.path.basename(args.module)
|
||||||
|
|
||||||
lang_p=re.compile("I18n\.lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
lang_p=re.compile(r"I18n\.lang\('("+module_base+r"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||||
#lang_t=re.compile("\${lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
#lang_t=re.compile("\${lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)\}")
|
||||||
lang_t=re.compile("lang\('("+module_base+"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
lang_t=re.compile(r"lang\('("+module_base+r"?)',\s+'(.*?)',\s+'(.*?)'\)")
|
||||||
|
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
from paramecio2.libraries.db.corefields import CharField
|
from paramecio2.libraries.db.corefields import CharField
|
||||||
import re
|
import re
|
||||||
|
|
||||||
mail_pattern=re.compile("\w[\w\.-]*@\w[\w\.-]+\.\w+")
|
mail_pattern=re.compile(r"\w[\w\.-]*@\w[\w\.-]+\.\w+")
|
||||||
|
|
||||||
class EmailField(CharField):
|
class EmailField(CharField):
|
||||||
"""Field for save and check email addreses"""
|
"""Field for save and check email addreses"""
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class UrlField(CharField):
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
check_domain=re.compile('^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$')
|
check_domain=re.compile(r'^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$')
|
||||||
|
|
||||||
class DomainField(CharField):
|
class DomainField(CharField):
|
||||||
"""Field for check and save strings in domain internet format"""
|
"""Field for check and save strings in domain internet format"""
|
||||||
|
|
@ -72,7 +72,7 @@ class DomainField(CharField):
|
||||||
|
|
||||||
#^(https|ssh):\/\/([a-zA-Z0-9\-_]+@)?[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*(:[0-9]+)?\/[a-zA-Z0-9\-_]+(\/[a-zA-Z0-9\-_]+)*(\.git)?$
|
#^(https|ssh):\/\/([a-zA-Z0-9\-_]+@)?[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*(:[0-9]+)?\/[a-zA-Z0-9\-_]+(\/[a-zA-Z0-9\-_]+)*(\.git)?$
|
||||||
|
|
||||||
check_git_url=re.compile('^(https|ssh):\/\/([a-zA-Z0-9\-_]+@)?[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*(:[a-zA-Z0-9\-_]+)?\/[a-zA-Z0-9\-_]+(\/[a-zA-Z0-9\-_]+)*(\.git)?$')
|
check_git_url=re.compile(r'^(https|ssh):\/\/([a-zA-Z0-9\-_]+@)?[a-zA-Z0-9\-_]+(\.[a-zA-Z0-9\-_]+)*(:[a-zA-Z0-9\-_]+)?\/[a-zA-Z0-9\-_]+(\/[a-zA-Z0-9\-_]+)*(\.git)?$')
|
||||||
|
|
||||||
class GitUrlField(CharField):
|
class GitUrlField(CharField):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue