File: format_regex.py

package info (click to toggle)
python-rcssmin 1%3A1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,172 kB
  • sloc: python: 2,264; ansic: 1,216; sh: 66; makefile: 19
file content (14 lines) | stat: -rwxr-xr-x 251 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
from __future__ import print_function

import sys

a = sys.argv[1]

while len(a) > 62:
    b, a = a[:62], a[62:]
    while b.endswith('\\'):
        b = b[:-1]
        a = '\\' + a
    print("r'%s'" % (b,))
print("r'%s'" % (a,))