mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
PEP-8
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import keyword
|
||||
import os
|
||||
|
||||
from pycharm_generator_utils.constants import *
|
||||
from pycharm_generator_utils.util_methods import *
|
||||
|
||||
is_pregenerated = os.getenv("IS_PREGENERATED_SKELETONS", None)
|
||||
|
||||
|
||||
class emptylistdict(dict):
|
||||
"""defaultdict not available before 2.5; simplest reimplementation using [] as default"""
|
||||
|
||||
@@ -17,6 +17,7 @@ class emptylistdict(dict):
|
||||
self.__setitem__(item, it)
|
||||
return it
|
||||
|
||||
|
||||
class Buf(object):
|
||||
"""Buffers data in a list, can write to a file. Indentation is provided externally."""
|
||||
|
||||
@@ -57,6 +58,7 @@ class ClassBuf(Buf):
|
||||
super(ClassBuf, self).__init__(indenter)
|
||||
self.name = name
|
||||
|
||||
|
||||
#noinspection PyUnresolvedReferences,PyBroadException
|
||||
class ModuleRedeclarator(object):
|
||||
def __init__(self, module, outfile, mod_filename, indent_size=4, doing_builtins=False):
|
||||
@@ -206,7 +208,6 @@ class ModuleRedeclarator(object):
|
||||
# NOTE: here we could handle things like defaultdict, sets, etc if we wanted
|
||||
return "None"
|
||||
|
||||
|
||||
def fmt_value(self, out, p_value, indent, prefix="", postfix="", as_name=None, seen_values=None):
|
||||
"""
|
||||
Formats and outputs value (it occupies an entire line or several lines).
|
||||
@@ -472,7 +473,6 @@ class ModuleRedeclarator(object):
|
||||
return self.doing_builtins and module_name == BUILTIN_MOD_NAME and (
|
||||
class_name, func_name) in PREDEFINED_BUILTIN_SIGS
|
||||
|
||||
|
||||
def redo_function(self, out, p_func, p_name, indent, p_class=None, p_modname=None, classname=None, seen=None):
|
||||
"""
|
||||
Restore function argument list as best we can.
|
||||
@@ -603,7 +603,6 @@ class ModuleRedeclarator(object):
|
||||
out(indent, p_name, " = ", deco, "(", p_name, ")", deco_comment)
|
||||
out(0, "") # empty line after each item
|
||||
|
||||
|
||||
def redo_class(self, out, p_class, p_name, indent, p_modname=None, seen=None, inspect_dir=False):
|
||||
"""
|
||||
Restores a class definition.
|
||||
@@ -765,8 +764,6 @@ class ModuleRedeclarator(object):
|
||||
if not methods and not properties and not others:
|
||||
out(indent + 1, "pass")
|
||||
|
||||
|
||||
|
||||
def redo_simple_header(self, p_name):
|
||||
"""Puts boilerplate code on the top"""
|
||||
out = self.header_buf.out # 1st class methods rule :)
|
||||
@@ -798,7 +795,6 @@ class ModuleRedeclarator(object):
|
||||
out(0, "from __future__ import print_function")
|
||||
out_doc_attr(out, self.module, 0)
|
||||
|
||||
|
||||
def redo_imports(self):
|
||||
module_type = type(sys)
|
||||
for item_name in self.module.__dict__.keys():
|
||||
@@ -820,7 +816,6 @@ class ModuleRedeclarator(object):
|
||||
self.imports_buf.out(0, "")
|
||||
self.imports_buf.out(0, "# imports")
|
||||
|
||||
|
||||
def redo(self, p_name, inspect_dir):
|
||||
"""
|
||||
Restores module declarations.
|
||||
|
||||
Reference in New Issue
Block a user