Encode the facility and priority. You can pass in strings or integers - if strings are passed, the facility_names and priority_names mapping dictionaries are used to convert them to integers.
(self, facility, priority)
| 953 | self.socktype = socktype |
| 954 | |
| 955 | def encodePriority(self, facility, priority): |
| 956 | """ |
| 957 | Encode the facility and priority. You can pass in strings or |
| 958 | integers - if strings are passed, the facility_names and |
| 959 | priority_names mapping dictionaries are used to convert them to |
| 960 | integers. |
| 961 | """ |
| 962 | if isinstance(facility, str): |
| 963 | facility = self.facility_names[facility] |
| 964 | if isinstance(priority, str): |
| 965 | priority = self.priority_names[priority] |
| 966 | return (facility << 3) | priority |
| 967 | |
| 968 | def close(self): |
| 969 | """ |