This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def wait_for_row_in_list_table(self, row_text): | |
| start_time = time.time() | |
| while True: | |
| try: | |
| table = self.browser.find_element_by_id("id_list_table") | |
| rows = table.find_elements_by_tag_name("tr") | |
| self.assertIn(row_text, [row.text for row in rows]) | |
| return | |
| except (AssertionError, WebDriverException) as e: | |
| if time.time() - start_time > MAX_WAIT: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Vagrant provision script for Digital Ocean | |
| # Creates a basic nginx/uwsgi/django/mysql box | |
| echo "Provisioning from gist" | |
| # Download and Install the Latest Updates for the OS | |
| apt-get update && apt-get upgrade -y | |
| # Set the Server Timezone to Europe/Amsterdam | |
| echo "Europe/Amsterdam" > /etc/timezone | |
| dpkg-reconfigure -f noninteractive tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def clip(text: str, max_len:'int > 0'=80) -> str: | |
| """Return text clipped at the last space before or after max_len""" | |
| end = None | |
| if len(text) > max_len: | |
| space_before = text.rfind(' ', 0, max_len) | |
| if space_before >= 0: | |
| end = space_before | |
| else: | |
| space_after = text.rfind(' ', max_len) |