當前位置: 首頁>>代碼示例>>Python>>正文


Python pycodestyle.readlines方法代碼示例

本文整理匯總了Python中pycodestyle.readlines方法的典型用法代碼示例。如果您正苦於以下問題:Python pycodestyle.readlines方法的具體用法?Python pycodestyle.readlines怎麽用?Python pycodestyle.readlines使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pycodestyle的用法示例。


在下文中一共展示了pycodestyle.readlines方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_file

# 需要導入模塊: import pycodestyle [as 別名]
# 或者: from pycodestyle import readlines [as 別名]
def load_file(self):
        if self.filename in ("stdin", "-", None):
            self.filename = "stdin"
            self.lines = pycodestyle.stdin_get_value().splitlines(True)
        else:
            self.lines = pycodestyle.readlines(self.filename)

        if not self.tree:
            self.tree = ast.parse("".join(self.lines)) 
開發者ID:graphql-python,項目名稱:gql,代碼行數:11,代碼來源:__init__.py

示例2: get_lines

# 需要導入模塊: import pycodestyle [as 別名]
# 或者: from pycodestyle import readlines [as 別名]
def get_lines(filename):
    if filename in ('stdin', '-', None):
        return stdin_utils.stdin_get_value().splitlines(True)
    else:
        return pep8.readlines(filename) 
開發者ID:ar4s,項目名稱:flake8_tuple,代碼行數:7,代碼來源:flake8_tuple.py

示例3: _load_source

# 需要導入模塊: import pycodestyle [as 別名]
# 或者: from pycodestyle import readlines [as 別名]
def _load_source(self):
        """Loads the file in a way that auto-detects source encoding and deals
        with broken terminal encodings for stdin.

        Stolen from flake8_import_order because it's good.
        """

        if self.filename in ("stdin", "-", None):
            self.filename = "stdin"
            self.lines = stdin_utils.stdin_get_value().splitlines(True)
        else:
            self.lines = pycodestyle.readlines(self.filename)
        if not self.tree:
            self.tree = ast.parse("".join(self.lines)) 
開發者ID:tylerwince,項目名稱:flake8-bandit,代碼行數:16,代碼來源:flake8_bandit.py

示例4: load_file

# 需要導入模塊: import pycodestyle [as 別名]
# 或者: from pycodestyle import readlines [as 別名]
def load_file(self):
        """Loads the file in a way that auto-detects source encoding and deals
        with broken terminal encodings for stdin.

        Stolen from flake8_import_order because it's good.
        """

        if self.filename in ("stdin", "-", None):
            self.filename = "stdin"
            self.lines = pycodestyle.stdin_get_value().splitlines(True)
        else:
            self.lines = pycodestyle.readlines(self.filename)

        if not self.tree:
            self.tree = ast.parse("".join(self.lines)) 
開發者ID:PyCQA,項目名稱:flake8-bugbear,代碼行數:17,代碼來源:bugbear.py

示例5: get_file_contents

# 需要導入模塊: import pycodestyle [as 別名]
# 或者: from pycodestyle import readlines [as 別名]
def get_file_contents(self):
        if self.filename in ('stdin', '-', None):
            return stdin_get_value().splitlines(True)
        else:
            if self.lines:
                return self.lines
            else:
                return readlines(self.filename) 
開發者ID:zheller,項目名稱:flake8-quotes,代碼行數:10,代碼來源:__init__.py


注:本文中的pycodestyle.readlines方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。