File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 3636import logging
3737import archive
3838import sys
39+ import re
3940
4041try :
4142 import requests
@@ -891,9 +892,14 @@ def package_wizard():
891892 #first step
892893 print ('\033 [5;33;40m\n 1.Please input a new package name :\033 [0m' )
893894 name = raw_input ()
894- while name == '' or name .isspace () == True :
895- print ('\033 [1;31;40mError: you must input a package name. Try again.\033 [0m' )
896- name = raw_input ()
895+ regular_obj = re .compile ('\W' )
896+ while name == '' or name .isspace () == True or regular_obj .search (name .strip ()):
897+ if name == '' or name .isspace ():
898+ print ('\033 [1;31;40mError: you must input a package name. Try again.\033 [0m' )
899+ name = raw_input ()
900+ else :
901+ print ('\033 [1;31;40mError: package name is made of alphabet, number and underline. Try again.\033 [0m' )
902+ name = raw_input ()
897903
898904 default_description = 'Please add description of ' + name + ' in English.'
899905 #description = user_input('menuconfig option name,default:\n',default_description)
You can’t perform that action at this time.
0 commit comments