Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
django /
utils /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
translation
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
_os.py
2.24
KB
-rw-r--r--
archive.py
7.88
KB
-rw-r--r--
asyncio.py
1.29
KB
-rw-r--r--
autoreload.py
23.67
KB
-rw-r--r--
baseconv.py
2.92
KB
-rw-r--r--
cache.py
15.88
KB
-rw-r--r--
connection.py
2.19
KB
-rw-r--r--
crypto.py
3.07
KB
-rw-r--r--
datastructures.py
9.66
KB
-rw-r--r--
dateformat.py
9.97
KB
-rw-r--r--
dateparse.py
4.78
KB
-rw-r--r--
dates.py
1.97
KB
-rw-r--r--
datetime_safe.py
2.79
KB
-rw-r--r--
deconstruct.py
1.93
KB
-rw-r--r--
decorators.py
6.67
KB
-rw-r--r--
deprecation.py
5.08
KB
-rw-r--r--
duration.py
1.21
KB
-rw-r--r--
encoding.py
9.2
KB
-rw-r--r--
feedgenerator.py
14.75
KB
-rw-r--r--
formats.py
8.82
KB
-rw-r--r--
functional.py
13.81
KB
-rw-r--r--
hashable.py
706
B
-rw-r--r--
html.py
15.19
KB
-rw-r--r--
http.py
17.29
KB
-rw-r--r--
inspect.py
2.23
KB
-rw-r--r--
ipv6.py
1.65
KB
-rw-r--r--
itercompat.py
184
B
-rw-r--r--
jslex.py
7.51
KB
-rw-r--r--
log.py
7.7
KB
-rw-r--r--
lorem_ipsum.py
4.66
KB
-rw-r--r--
module_loading.py
3.51
KB
-rw-r--r--
numberformat.py
3.53
KB
-rw-r--r--
regex_helper.py
12.44
KB
-rw-r--r--
safestring.py
1.72
KB
-rw-r--r--
termcolors.py
7.19
KB
-rw-r--r--
text.py
15.49
KB
-rw-r--r--
timesince.py
3.41
KB
-rw-r--r--
timezone.py
7.98
KB
-rw-r--r--
topological_sort.py
1.18
KB
-rw-r--r--
tree.py
4.8
KB
-rw-r--r--
version.py
3.34
KB
-rw-r--r--
xmlutils.py
1.12
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : timesince.py
import calendar import datetime from django.utils.html import avoid_wrapping from django.utils.timezone import is_aware, utc from django.utils.translation import gettext, ngettext_lazy TIME_STRINGS = { 'year': ngettext_lazy('%d year', '%d years'), 'month': ngettext_lazy('%d month', '%d months'), 'week': ngettext_lazy('%d week', '%d weeks'), 'day': ngettext_lazy('%d day', '%d days'), 'hour': ngettext_lazy('%d hour', '%d hours'), 'minute': ngettext_lazy('%d minute', '%d minutes'), } TIMESINCE_CHUNKS = ( (60 * 60 * 24 * 365, 'year'), (60 * 60 * 24 * 30, 'month'), (60 * 60 * 24 * 7, 'week'), (60 * 60 * 24, 'day'), (60 * 60, 'hour'), (60, 'minute'), ) def timesince(d, now=None, reversed=False, time_strings=None, depth=2): """ Take two datetime objects and return the time between d and now as a nicely formatted string, e.g. "10 minutes". If d occurs after now, return "0 minutes". Units used are years, months, weeks, days, hours, and minutes. Seconds and microseconds are ignored. Up to `depth` adjacent units will be displayed. For example, "2 weeks, 3 days" and "1 year, 3 months" are possible outputs, but "2 weeks, 3 hours" and "1 year, 5 days" are not. `time_strings` is an optional dict of strings to replace the default TIME_STRINGS dict. `depth` is an optional integer to control the number of adjacent time units returned. Adapted from https://web.archive.org/web/20060617175230/http://blog.natbat.co.uk/archive/2003/Jun/14/time_since """ if time_strings is None: time_strings = TIME_STRINGS if depth <= 0: raise ValueError('depth must be greater than 0.') # Convert datetime.date to datetime.datetime for comparison. if not isinstance(d, datetime.datetime): d = datetime.datetime(d.year, d.month, d.day) if now and not isinstance(now, datetime.datetime): now = datetime.datetime(now.year, now.month, now.day) now = now or datetime.datetime.now(utc if is_aware(d) else None) if reversed: d, now = now, d delta = now - d # Deal with leapyears by subtracing the number of leapdays leapdays = calendar.leapdays(d.year, now.year) if leapdays != 0: if calendar.isleap(d.year): leapdays -= 1 elif calendar.isleap(now.year): leapdays += 1 delta -= datetime.timedelta(leapdays) # ignore microseconds since = delta.days * 24 * 60 * 60 + delta.seconds if since <= 0: # d is in the future compared to now, stop processing. return avoid_wrapping(time_strings['minute'] % 0) for i, (seconds, name) in enumerate(TIMESINCE_CHUNKS): count = since // seconds if count != 0: break else: return avoid_wrapping(time_strings['minute'] % 0) result = [] current_depth = 0 while i < len(TIMESINCE_CHUNKS) and current_depth < depth: seconds, name = TIMESINCE_CHUNKS[i] count = since // seconds if count == 0: break result.append(avoid_wrapping(time_strings[name] % count)) since -= seconds * count current_depth += 1 i += 1 return gettext(', ').join(result) def timeuntil(d, now=None, time_strings=None, depth=2): """ Like timesince, but return a string measuring the time until the given time. """ return timesince(d, now, reversed=True, time_strings=time_strings, depth=depth)
Close