Linux server19.dn-server.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64
LiteSpeed
Server IP : 46.209.20.154 & Your IP : 216.73.217.55
Domains :
Cant Read [ /etc/named.conf ]
User : emadteam
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
paste /
util /
Delete
Unzip
Name
Size
Permission
Date
Action
looper
[ DIR ]
drwxr-xr-x
2022-08-06 15:50
template
[ DIR ]
drwxr-xr-x
2022-08-06 15:50
PySourceColor.py
83.85
KB
-rw-r--r--
2011-12-21 20:42
PySourceColor.pyc
53.03
KB
-rw-r--r--
2014-09-17 20:43
PySourceColor.pyo
53.03
KB
-rw-r--r--
2014-09-17 20:43
UserDict24.py
5.39
KB
-rw-r--r--
2011-12-21 20:42
UserDict24.pyc
9.61
KB
-rw-r--r--
2014-09-17 20:43
UserDict24.pyo
9.61
KB
-rw-r--r--
2014-09-17 20:43
__init__.py
86
B
-rw-r--r--
2011-12-21 20:42
__init__.pyc
244
B
-rw-r--r--
2014-09-17 20:43
__init__.pyo
244
B
-rw-r--r--
2014-09-17 20:43
classinit.py
1.81
KB
-rw-r--r--
2011-12-21 20:42
classinit.pyc
1.82
KB
-rw-r--r--
2014-09-17 20:43
classinit.pyo
1.82
KB
-rw-r--r--
2014-09-17 20:43
classinstance.py
1.34
KB
-rw-r--r--
2011-12-21 20:42
classinstance.pyc
2.17
KB
-rw-r--r--
2014-09-17 20:43
classinstance.pyo
2.01
KB
-rw-r--r--
2014-09-17 20:43
converters.py
863
B
-rw-r--r--
2011-12-21 20:42
converters.pyc
1.08
KB
-rw-r--r--
2014-09-17 20:43
converters.pyo
1.08
KB
-rw-r--r--
2014-09-17 20:43
dateinterval.py
2.36
KB
-rw-r--r--
2011-12-21 20:42
dateinterval.pyc
2.99
KB
-rw-r--r--
2014-09-17 20:43
dateinterval.pyo
2.99
KB
-rw-r--r--
2014-09-17 20:43
datetimeutil.py
10.91
KB
-rw-r--r--
2011-12-21 20:42
datetimeutil.pyc
9.75
KB
-rw-r--r--
2014-09-17 20:43
datetimeutil.pyo
9.75
KB
-rw-r--r--
2014-09-17 20:43
doctest24.py
97.09
KB
-rw-r--r--
2011-12-21 20:42
doctest24.pyc
80.5
KB
-rw-r--r--
2014-09-17 20:43
doctest24.pyo
80.22
KB
-rw-r--r--
2014-09-17 20:43
filemixin.py
1.4
KB
-rw-r--r--
2011-12-21 20:42
filemixin.pyc
1.92
KB
-rw-r--r--
2014-09-17 20:43
filemixin.pyo
1.92
KB
-rw-r--r--
2014-09-17 20:43
finddata.py
3.75
KB
-rw-r--r--
2011-12-21 20:42
finddata.pyc
2.83
KB
-rw-r--r--
2014-09-17 20:43
finddata.pyo
2.83
KB
-rw-r--r--
2014-09-17 20:43
findpackage.py
786
B
-rw-r--r--
2011-12-21 20:42
findpackage.pyc
884
B
-rw-r--r--
2014-09-17 20:43
findpackage.pyo
884
B
-rw-r--r--
2014-09-17 20:43
import_string.py
3.04
KB
-rw-r--r--
2011-12-21 20:42
import_string.pyc
3.18
KB
-rw-r--r--
2014-09-17 20:43
import_string.pyo
3.18
KB
-rw-r--r--
2014-09-17 20:43
intset.py
18.68
KB
-rw-r--r--
2011-12-21 20:42
intset.pyc
18.28
KB
-rw-r--r--
2014-09-17 20:43
intset.pyo
18.28
KB
-rw-r--r--
2014-09-17 20:43
ip4.py
9.05
KB
-rw-r--r--
2011-12-21 20:42
ip4.pyc
8.72
KB
-rw-r--r--
2014-09-17 20:43
ip4.pyo
8.72
KB
-rw-r--r--
2014-09-17 20:43
killthread.py
1.2
KB
-rw-r--r--
2011-12-21 20:42
killthread.pyc
1.36
KB
-rw-r--r--
2014-09-17 20:43
killthread.pyo
1.36
KB
-rw-r--r--
2014-09-17 20:43
looper.py.tmpta
3.88
KB
-rw-r--r--
2011-12-21 20:42
mimeparse.py
6.44
KB
-rw-r--r--
2011-12-21 20:42
mimeparse.pyc
6.81
KB
-rw-r--r--
2014-09-17 20:43
mimeparse.pyo
6.81
KB
-rw-r--r--
2014-09-17 20:43
multidict.py
11.14
KB
-rw-r--r--
2011-12-21 20:42
multidict.pyc
15.44
KB
-rw-r--r--
2014-09-17 20:43
multidict.pyo
15.44
KB
-rw-r--r--
2014-09-17 20:43
quoting.py
2.42
KB
-rw-r--r--
2011-12-21 20:42
quoting.pyc
2.84
KB
-rw-r--r--
2014-09-17 20:43
quoting.pyo
2.84
KB
-rw-r--r--
2014-09-17 20:43
scgiserver.py
5.5
KB
-rw-r--r--
2014-09-17 20:43
scgiserver.pyc
5.83
KB
-rw-r--r--
2014-09-17 20:43
scgiserver.pyo
5.72
KB
-rw-r--r--
2014-09-17 20:43
string24.py
16.35
KB
-rw-r--r--
2011-12-21 20:42
string24.pyc
17.67
KB
-rw-r--r--
2014-09-17 20:43
string24.pyo
17.67
KB
-rw-r--r--
2014-09-17 20:43
template.py.tmpta
23.73
KB
-rw-r--r--
2011-12-21 20:42
threadedprint.py
8.02
KB
-rw-r--r--
2011-12-21 20:42
threadedprint.pyc
9.76
KB
-rw-r--r--
2014-09-17 20:43
threadedprint.pyo
8.46
KB
-rw-r--r--
2014-09-17 20:43
threadinglocal.py
1.45
KB
-rw-r--r--
2011-12-21 20:42
threadinglocal.pyc
1.91
KB
-rw-r--r--
2014-09-17 20:43
threadinglocal.pyo
1.91
KB
-rw-r--r--
2014-09-17 20:43
Save
Rename
""" Helper for looping over sequences, particular in templates. Often in a loop in a template it's handy to know what's next up, previously up, if this is the first or last item in the sequence, etc. These can be awkward to manage in a normal Python loop, but using the looper you can get a better sense of the context. Use like:: >>> for loop, item in looper(['a', 'b', 'c']): ... print loop.number, item ... if not loop.last: ... print '---' 1 a --- 2 b --- 3 c """ __all__ = ['looper'] class looper(object): """ Helper for looping (particularly in templates) Use this like:: for loop, item in looper(seq): if loop.first: ... """ def __init__(self, seq): self.seq = seq def __iter__(self): return looper_iter(self.seq) def __repr__(self): return '<%s for %r>' % ( self.__class__.__name__, self.seq) class looper_iter(object): def __init__(self, seq): self.seq = list(seq) self.pos = 0 def __iter__(self): return self def next(self): if self.pos >= len(self.seq): raise StopIteration result = loop_pos(self.seq, self.pos), self.seq[self.pos] self.pos += 1 return result class loop_pos(object): def __init__(self, seq, pos): self.seq = seq self.pos = pos def __repr__(self): return '<loop pos=%r at %r>' % ( self.seq[pos], pos) def index(self): return self.pos index = property(index) def number(self): return self.pos + 1 number = property(number) def item(self): return self.seq[self.pos] item = property(item) def next(self): try: return self.seq[self.pos+1] except IndexError: return None next = property(next) def previous(self): if self.pos == 0: return None return self.seq[self.pos-1] previous = property(previous) def odd(self): return not self.pos % 2 odd = property(odd) def even(self): return self.pos % 2 even = property(even) def first(self): return self.pos == 0 first = property(first) def last(self): return self.pos == len(self.seq)-1 last = property(last) def length(self): return len(self.seq) length = property(length) def first_group(self, getter=None): """ Returns true if this item is the start of a new group, where groups mean that some attribute has changed. The getter can be None (the item itself changes), an attribute name like ``'.attr'``, a function, or a dict key or list index. """ if self.first: return True return self._compare_group(self.item, self.previous, getter) def last_group(self, getter=None): """ Returns true if this item is the end of a new group, where groups mean that some attribute has changed. The getter can be None (the item itself changes), an attribute name like ``'.attr'``, a function, or a dict key or list index. """ if self.last: return True return self._compare_group(self.item, self.next, getter) def _compare_group(self, item, other, getter): if getter is None: return item != other elif (isinstance(getter, basestring) and getter.startswith('.')): getter = getter[1:] if getter.endswith('()'): getter = getter[:-2] return getattr(item, getter)() != getattr(other, getter)() else: return getattr(item, getter) != getattr(other, getter) elif callable(getter): return getter(item) != getter(other) else: return item[getter] != other[getter]