utils
block_code_macro_confluence(code, lang=None)
Wrap into code block macro :param code: :param lang: :return:
Source code in server/vendor/atlassian/utils.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
|
html_code__macro_confluence(text)
Wrap into html macro :param text: :return:
Source code in server/vendor/atlassian/utils.py
226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
html_email(email, title=None)
Source code in server/vendor/atlassian/utils.py
21 22 23 24 25 26 27 28 29 30 |
|
html_list(data)
html_list(['example.com', 'admin1@example.com', 'admin2@example.com']) '
'
Source code in server/vendor/atlassian/utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
html_row_with_ordered_headers(data, col_headers, row_header=None)
headers = ['administrators', 'key', 'leader', 'project'] data = {'key': 'DEMO', 'project': 'Demonstration', 'leader': 'leader@example.com', 'administrators': ['admin1@example.com', 'admin2@example.com']} html_row_with_ordered_headers(data, headers) '\n\t
' headers = ['key', 'project', 'leader', 'administrators'] html_row_with_ordered_headers(data, headers) '\n\t DEMO leader@example.com Demonstration ' DEMO Demonstration leader@example.com
Source code in server/vendor/atlassian/utils.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
html_table_from_dict(data, ordering)
ordering = ['administrators', 'key', 'leader', 'project'] data = [ {'key': 'DEMO', 'project': 'Demo project', 'leader': 'lead@example.com', 'administrators': ['admin@example.com', 'root@example.com']},] html_table_from_dict(data, ordering) '
\n
' ordering = ['key', 'project', 'leader', 'administrators'] html_table_from_dict(data, ordering) '\n Administrators Key Leader Project \n DEMO lead@example.com Demo project \n
'\n Key Project Leader Administrators \n DEMO Demo project lead@example.com
Source code in server/vendor/atlassian/utils.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
html_table_from_nested_dict(data, ordering)
ordering = ['manager', 'admin', 'employee_count'] data = { 'project_A': {'manager': 'John', 'admin': 'admin1@example.com', 'employee_count': '4'}, 'project_B': {'manager': 'Jane', 'admin': 'admin2@example.com', 'employee_count': '7'} } html_table_from_nested_dict(data, ordering)
Manager | Admin | Employee Count | |
---|---|---|---|
Project A | John | admin1@example.com | 4 |
Project B | Jane | admin2@example.com | 7 |
Source code in server/vendor/atlassian/utils.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
html_table_header_row(data)
html_table_header_row(['administrators', 'key', 'leader', 'project']) '\n\t
' html_table_header_row(['key', 'project', 'leader', 'administrators']) '\n\t Administrators Key Leader Project ' Key Project Leader Administrators
Source code in server/vendor/atlassian/utils.py
56 57 58 59 60 61 62 63 64 65 66 67 |
|
is_email(element)
is_email('username@example.com') True is_email('example.com') False is_email('firstname.lastname@domain.co.uk') True
Source code in server/vendor/atlassian/utils.py
8 9 10 11 12 13 14 15 16 17 18 |
|
noformat_code_macro_confluence(text, nopanel=None)
Wrap into code block macro :param text: :param nopanel: (bool) True or False Removes the panel around the content. :return:
Source code in server/vendor/atlassian/utils.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
|
parse_cookie_file(cookie_file)
Parse a cookies.txt file (Netscape HTTP Cookie File) return a dictionary of key value pairs compatible with requests. :param cookie_file: a cookie file :return dict of cookies pairs
Source code in server/vendor/atlassian/utils.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
|