def __get_property(Name_or_Alias): ucs_property_db.init_db() property = ucs_property_db[Name_or_Alias] if property.__class__.__name__ != "PropertyInfo": print property if Name_or_Alias.find("=") != -1: print "Use command line option `--set-by-property` to investigate property settings." if Name_or_Alias.find("(") != -1: print "Use command line option `--set-by-expression` to investigate character set operations." return None property.init_code_point_db() return property
def __handle_property(cl): property_follower = cl.follow("", "--property") if property_follower == "": # no specific property => display all properties in the database sys.stderr.write("(please, wait for database parsing to complete)\n") ucs_property_db.init_db() print ucs_property_db.get_property_descriptions() else: # specific property => display information about it sys.stderr.write("(please, wait for database parsing to complete)\n") property = __get_property(property_follower) if property == None: return True print property