|
|
|
@ -4,7 +4,6 @@ from json import dumps |
|
|
|
import socket |
|
|
|
import struct |
|
|
|
from collections import Iterator |
|
|
|
import os |
|
|
|
from functools import wraps |
|
|
|
from django.http import HttpResponse, Http404, HttpResponseRedirect |
|
|
|
from django.shortcuts import redirect |
|
|
|
@ -118,11 +117,6 @@ def only_admins(fn): |
|
|
|
return wrapped |
|
|
|
|
|
|
|
|
|
|
|
def ping(hostname: str, count=1): |
|
|
|
response = os.system("`which ping` -4Anq -c%d -W1 %s > /dev/null" % (count, hostname)) |
|
|
|
return True if response == 0 else False |
|
|
|
|
|
|
|
|
|
|
|
# Русифицированный вывод timedelta |
|
|
|
class RuTimedelta(timedelta): |
|
|
|
def __new__(cls, tm): |
|
|
|
|