idolezal commited on
Commit
090213e
1 Parent(s): fd7c00b

Strip to abbreviate

Browse files
Files changed (1) hide show
  1. server.py +3 -3
server.py CHANGED
@@ -184,13 +184,13 @@ class LeaderboardServer:
184
  if max_length <= 1:
185
  return "…"
186
  elif dots_place == "begin":
187
- return "…" + s[-max_length + 1:]
188
  elif dots_place == "center" and max_length >= 3:
189
  max_length_begin = max_length // 2
190
  max_length_end = max_length - max_length_begin - 1
191
- return s[:max_length_begin] + "…" + s[-max_length_end:]
192
  else: # dots_place == "end"
193
- return s[:max_length - 1] + "…"
194
 
195
  @staticmethod
196
  def create_submission_id(metadata):
 
184
  if max_length <= 1:
185
  return "…"
186
  elif dots_place == "begin":
187
+ return "…" + s[-max_length + 1:].lstrip()
188
  elif dots_place == "center" and max_length >= 3:
189
  max_length_begin = max_length // 2
190
  max_length_end = max_length - max_length_begin - 1
191
+ return s[:max_length_begin].rstrip() + "…" + s[-max_length_end:].lstrip()
192
  else: # dots_place == "end"
193
+ return s[:max_length - 1].rstrip() + "…"
194
 
195
  @staticmethod
196
  def create_submission_id(metadata):