flake8 fixes
This commit is contained in:
parent
556f8a1fcd
commit
13f4023bf5
3 changed files with 7 additions and 5 deletions
|
|
@ -49,7 +49,6 @@ import warnings
|
|||
import weakref
|
||||
import xml.sax
|
||||
import xml.sax.handler
|
||||
from contextlib import contextmanager
|
||||
from fnmatch import fnmatch
|
||||
|
||||
import dateutil.parser
|
||||
|
|
@ -1276,6 +1275,7 @@ def _open_text_file(path, mode='rt'):
|
|||
return open(path, mode, encoding='utf-8')
|
||||
# END kojikamid dup $
|
||||
|
||||
|
||||
ENTITY_RE = re.compile(r'&[A-Za-z0-9]+;')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class fakemodule(object):
|
|||
koji = fakemodule()
|
||||
koji.GenericError = GenericError # noqa: F821
|
||||
koji.BuildError = BuildError # noqa: F821
|
||||
koji._open_text_file = _open_text_file # noqa: F821
|
||||
|
||||
|
||||
def encode_int(n):
|
||||
|
|
@ -331,7 +332,7 @@ class WindowsBuild(object):
|
|||
raise BuildError('Unknown checksum type %s for %s' % ( # noqa: F821
|
||||
checksum_type,
|
||||
os.path.basename(fileinfo['localpath'])))
|
||||
with _open_text_file(destpath, 'wt') as destfile:
|
||||
with koji._open_text_file(destpath, 'wt') as destfile:
|
||||
offset = 0
|
||||
while True:
|
||||
encoded = self.server.getFile(buildinfo, fileinfo, encode_int(offset), 1048576,
|
||||
|
|
@ -412,7 +413,7 @@ class WindowsBuild(object):
|
|||
"""Do the build: run the execute line(s) with cmd.exe"""
|
||||
tmpfd, tmpname = tempfile.mkstemp(prefix='koji-tmp', suffix='.bat',
|
||||
dir='/cygdrive/c/Windows/Temp')
|
||||
script = _open_text_file(tmpfd, 'wt')
|
||||
script = koji._open_text_file(tmpfd, 'wt')
|
||||
for attr in ['source_dir', 'spec_dir', 'patches_dir']:
|
||||
val = getattr(self, attr)
|
||||
if val:
|
||||
|
|
@ -449,7 +450,7 @@ class WindowsBuild(object):
|
|||
def bashBuild(self):
|
||||
"""Do the build: run the execute line(s) with bash"""
|
||||
tmpfd, tmpname = tempfile.mkstemp(prefix='koji-tmp.', dir='/tmp')
|
||||
script = _open_text_file(tmpfd, 'wt')
|
||||
script = koji._open_text_file(tmpfd, 'wt')
|
||||
script.write("export source_dir='%s'\n" % self.source_dir)
|
||||
script.write("export spec_dir='%s'\n" % self.spec_dir)
|
||||
if self.patches_dir:
|
||||
|
|
@ -657,7 +658,7 @@ def setup_logging(opts):
|
|||
if opts.debug:
|
||||
level = logging.DEBUG
|
||||
logger.setLevel(level)
|
||||
logfd = _open_text_file(logfile, 'wt')
|
||||
logfd = koji._open_text_file(logfile, 'wt')
|
||||
handler = logging.StreamHandler(logfd)
|
||||
handler.setLevel(level)
|
||||
handler.setFormatter(logging.Formatter('%(asctime)s [%(levelname)s] %(name)s: %(message)s'))
|
||||
|
|
|
|||
|
|
@ -1461,6 +1461,7 @@ def userinfo(environ, userID, packageOrder='package_name', packageStart=None,
|
|||
# headers shown in rpminfo and buildinfo pages
|
||||
RPM_HEADERS = ['summary', 'description', 'license', 'disturl', 'vcs']
|
||||
|
||||
|
||||
def rpminfo(environ, rpmID, fileOrder='name', fileStart=None, buildrootOrder='-id',
|
||||
buildrootStart=None):
|
||||
values = _initValues(environ, 'RPM Info', 'builds')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue