Verified Commit 9a2c6cb3 authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Remove six

parent 290c2e15
......@@ -2,7 +2,7 @@
# ----------------------------------------------------------------------
# MAC Model
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
......@@ -10,9 +10,6 @@
from collections import defaultdict
import datetime
# Third-party modules
from six.moves import zip
# NOC modules
from noc.config import config
from noc.core.clickhouse.model import Model
......
......@@ -2,16 +2,14 @@
# ---------------------------------------------------------------------
# Import DNS Zone
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import argparse
import re
# Third-party modules
from six.moves import zip_longest
from itertools import zip_longest
# NOC modules
from noc.core.management.base import BaseCommand, CommandError
......
......@@ -2,16 +2,14 @@
# ---------------------------------------------------------------------
# ./noc dump-crashinfo
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import argparse
import time
# Third-party modules
from six.moves.cPickle import load
from pickle import load
# NOC modules
from noc.core.management.base import BaseCommand
......
......@@ -11,9 +11,9 @@ import re
import datetime
import time
import hashlib
from html.entities import name2codepoint
# Third-party modules
from six.moves.html_entities import name2codepoint
from bson import ObjectId
from pymongo import DeleteMany
from pymongo.errors import DocumentTooLarge
......
......@@ -2,14 +2,13 @@
# ----------------------------------------------------------------------
# Service command
# ----------------------------------------------------------------------
# Copyright (C) 2007-2017 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Python modules
import argparse
# Third-party modules
# NOC modules
from noc.core.management.base import BaseCommand
from noc.core.mongo.connection import connect
......
......@@ -2,7 +2,7 @@
# ---------------------------------------------------------------------
# Rebuild online documentation
# ---------------------------------------------------------------------
# Copyright (C) 2007-2017 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -13,9 +13,7 @@ import glob
import subprocess
import csv
import sys
# Third-party modules
import six
from io import StringIO
# NOC modules
from noc.core.management.base import BaseCommand, CommandError
......@@ -35,7 +33,7 @@ class Command(BaseCommand):
# Returns true if database was updated
#
def update_se_db(self):
out = six.StringIO()
out = StringIO()
writer = csv.writer(out)
for dirpath, dirname, files in os.walk("sa/profiles/"):
if "supported.csv" in files:
......
......@@ -2,16 +2,14 @@
# ---------------------------------------------------------------------
# Update address database
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import os
import inspect
# Third-party modules
from six.moves.configparser import SafeConfigParser
from configparser import SafeConfigParser
# NOC modules
from noc.core.management.base import BaseCommand, CommandError
......
......@@ -12,9 +12,7 @@ import os
import socket
import sys
from collections import namedtuple
# Third-party modules
from six.moves.urllib.parse import quote as urllib_quote
from urllib.parse import quote as urllib_quote
# NOC modules
from noc.core.config.base import BaseConfig, ConfigSection
......
......@@ -2,7 +2,7 @@
# ----------------------------------------------------------------------
# Memcached backend
# ----------------------------------------------------------------------
# Copyright (C) 2007-2017 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
......@@ -10,7 +10,6 @@
import logging
# Third-party modules
from six.moves import zip
import pylibmc
import pylibmc.pools
......
......@@ -2,16 +2,16 @@
# ----------------------------------------------------------------------
# Mongo backend
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Python modules
import datetime
from pickle import loads, dumps, HIGHEST_PROTOCOL
# Third-party modules
import bson
from six.moves.cPickle import loads, dumps, HIGHEST_PROTOCOL
# NOC modules
from .base import BaseCache
......
......@@ -2,13 +2,15 @@
# ----------------------------------------------------------------------
# Redis backend
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Python modules
from pickle import loads, dumps, HIGHEST_PROTOCOL
# Third-party modules
import redis
from six.moves.cPickle import loads, dumps, HIGHEST_PROTOCOL
# NOC modules
from noc.config import config
......
......@@ -8,9 +8,7 @@
# Python modules
import random
# Third-party modules
from six.moves.urllib.parse import quote as urllib_quote
from urllib.parse import quote as urllib_quote
# NOC modules
from noc.core.http.client import fetch_sync
......
......@@ -14,9 +14,6 @@ import socket
import struct
from collections import defaultdict
# Third-party modules
from six.moves import zip
# NOC modules
from noc.config import config
......
......@@ -44,3 +44,15 @@ def bchr(x: int) -> bytes:
def make_bytes(x: List[int]) -> bytes:
return bytes(x)
def reraise(tp, value, tb=None):
try:
if value is None:
value = tp()
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
finally:
value = None
tb = None
......@@ -13,9 +13,6 @@ import types
import re
from collections import defaultdict
# Third-party modules
from six.moves import zip
# NOC modules
from noc.core.vlan import has_vlan, optimize_filter
from .transformer import PredicateTransformer
......
......@@ -9,9 +9,7 @@
# Python modules
import ast
import itertools
# Third-party modules
from six.moves import zip_longest
from itertools import zip_longest
CVAR_NAME = "_ctx"
......
......@@ -6,8 +6,8 @@
# See LICENSE for details
# ----------------------------------------------------------------------
# Third-party modules
from six.moves.configparser import RawConfigParser
# Python modules
from configparser import RawConfigParser
# NOC modules
from .base import BaseTokenizer
......
......@@ -2,12 +2,12 @@
# ----------------------------------------------------------------------
# Base config protocol class
# ----------------------------------------------------------------------
# Copyright (C) 2007-2017 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# Third-party modules
from six.moves.urllib.parse import unquote, urlparse
# Python modules
from urllib.parse import unquote, urlparse
class BaseProtocol(object):
......
......@@ -8,9 +8,9 @@
# Python modules
import os
from itertools import zip_longest
# Third-party modules
from six.moves import zip_longest
import yaml
# NOC modules
......
......@@ -8,10 +8,7 @@
# Python modules
import csv
# Third-party modules
import six
from six.moves import zip
from io import StringIO
# Third-party modules
from django.db import models
......@@ -83,7 +80,7 @@ def csv_export(model, queryset=None, first_row_only=False):
"""
Export to CSV
"""
io = six.StringIO()
io = StringIO()
writer = csv.writer(io)
fields = get_model_fields(model)
# Write header
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment