1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-22 21:16:16 +01:00

python3 compatibility: new syntax for literals

The octal literals got a new syntax 0755 -> 0o755
This commit is contained in:
Michal Vyskocil 2013-04-09 12:45:16 +02:00 committed by Adrian Schröter
parent 87d354e1a0
commit 0dcbddbafe
4 changed files with 8 additions and 8 deletions

View File

@ -6068,7 +6068,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
target_dir = os.path.normpath(opts.destdir)
if not os.path.isdir(target_dir):
print 'Creating %s' % target_dir
os.makedirs(target_dir, 0755)
os.makedirs(target_dir, 0o755)
for arch in arches:
for pac in package:

View File

@ -565,7 +565,7 @@ def init_basicauth(config):
except IOError:
try:
open(cookie_file, 'w').close()
os.chmod(cookie_file, 0600)
os.chmod(cookie_file, 0o600)
except:
#print 'Unable to create cookiejar file: \'%s\'. Using RAM-based cookies.' % cookie_file
cookiejar = CookieJar()
@ -597,7 +597,7 @@ def write_config(fname, cp):
cp.write(f, comments=True)
try:
os.rename(fname + '.new', fname)
os.chmod(fname, 0600)
os.chmod(fname, 0o600)
except:
if os.path.exists(fname + '.new'):
os.unlink(fname + '.new')
@ -758,7 +758,7 @@ def get_config(override_conffile=None,
# okay, we made sure that .oscrc exists
# make sure it is not world readable, it may contain a password.
os.chmod(conffile, 0600)
os.chmod(conffile, 0o600)
cp = get_configParser(conffile)

View File

@ -3930,7 +3930,7 @@ def download(url, filename, progress_obj = None, mtime = None):
prefix = os.path.basename(filename)
path = os.path.dirname(filename)
(fd, tmpfile) = tempfile.mkstemp(dir=path, prefix = prefix, suffix = '.osctmp')
os.chmod(tmpfile, 0644)
os.chmod(tmpfile, 0o644)
try:
o = os.fdopen(fd, 'wb')
for buf in streamfile(url, http_GET, BUFSIZE, progress_obj=progress_obj):

View File

@ -198,13 +198,13 @@ class Fetcher:
pac_obj.filename = canonname
pac_obj.fullfilename = fullfilename
shutil.move(tmpfile, fullfilename)
os.chmod(fullfilename, 0644)
os.chmod(fullfilename, 0o644)
def dirSetup(self, pac):
dir = os.path.join(self.cachedir, pac.localdir)
if not os.path.exists(dir):
try:
os.makedirs(dir, mode=0755)
os.makedirs(dir, mode=0o755)
except OSError as e:
print >>sys.stderr, 'packagecachedir is not writable for you?'
print >>sys.stderr, e
@ -250,7 +250,7 @@ class Fetcher:
for i in prjs:
dest = "%s/%s" % (self.cachedir, i)
if not os.path.exists(dest):
os.makedirs(dest, mode=0755)
os.makedirs(dest, mode=0o755)
dest += '/_pubkey'
url = makeurl(buildinfo.apiurl, ['source', i, '_pubkey'])