Mageia Bugzilla – Attachment 6913 Details for
Bug 16524
Adapting msec to python 3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Syntax corrections
0001-Syntax-corrections-for-string-replace-join-and-for-o.patch (text/plain), 1.59 KB, created by
papoteur
on 2015-08-07 07:37:27 CEST
(
hide
)
Description:
Syntax corrections
Filename:
MIME Type:
Creator:
papoteur
Created:
2015-08-07 07:37:27 CEST
Size:
1.59 KB
patch
obsolete
>From 39d5cfc9cc371e3fb10a921c4e03e32681ba5a7a Mon Sep 17 00:00:00 2001 >From: Papoteur <papoteur@mageialinux-online.org> >Date: Fri, 7 Aug 2015 07:19:48 +0200 >Subject: [PATCH] Syntax corrections for string replace, join and for os.error > >--- > src/msec/libmsec.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py >index bf6a242..95b5060 100755 >--- a/src/msec/libmsec.py >+++ b/src/msec/libmsec.py >@@ -86,7 +86,7 @@ def move(old, new): > def substitute_re_result(res, s): > for idx in range(0, (res.lastindex or 0) + 1): > subst = res.group(idx) or '' >- s = string.replace(s, '@' + str(idx), subst) >+ s = s.replace('@' + str(idx), subst) > return s > > # }}} >@@ -378,7 +378,7 @@ class ConfigFile: > try: > os.unlink(self.path) > except: >- error('unlink %s: %s' % (self.pathN, str(sys.exc_info()[1]))) >+ os.error('unlink %s: %s' % (self.pathN, str(sys.exc_info()[1]))) > self.log.info(_('deleted %s') % (self.pathN,)) > elif self.is_touched: > if os.path.exists(self.path): >@@ -431,7 +431,7 @@ class ConfigFile: > self.log.info(_('moved file %s to %s') % (self.path, self.path + self.suffixN)) > self.meta.modified(self.path) > elif self.is_modified: >- content = string.join(self.lines, "\n") >+ content = "\n".join(self.lines) > dirname = os.path.dirname(self.path) > if not os.path.exists(dirname): > os.makedirs(dirname) >-- >2.3.8 >
From 39d5cfc9cc371e3fb10a921c4e03e32681ba5a7a Mon Sep 17 00:00:00 2001 From: Papoteur <papoteur@mageialinux-online.org> Date: Fri, 7 Aug 2015 07:19:48 +0200 Subject: [PATCH] Syntax corrections for string replace, join and for os.error --- src/msec/libmsec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index bf6a242..95b5060 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -86,7 +86,7 @@ def move(old, new): def substitute_re_result(res, s): for idx in range(0, (res.lastindex or 0) + 1): subst = res.group(idx) or '' - s = string.replace(s, '@' + str(idx), subst) + s = s.replace('@' + str(idx), subst) return s # }}} @@ -378,7 +378,7 @@ class ConfigFile: try: os.unlink(self.path) except: - error('unlink %s: %s' % (self.pathN, str(sys.exc_info()[1]))) + os.error('unlink %s: %s' % (self.pathN, str(sys.exc_info()[1]))) self.log.info(_('deleted %s') % (self.pathN,)) elif self.is_touched: if os.path.exists(self.path): @@ -431,7 +431,7 @@ class ConfigFile: self.log.info(_('moved file %s to %s') % (self.path, self.path + self.suffixN)) self.meta.modified(self.path) elif self.is_modified: - content = string.join(self.lines, "\n") + content = "\n".join(self.lines) dirname = os.path.dirname(self.path) if not os.path.exists(dirname): os.makedirs(dirname) -- 2.3.8
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16524
:
6881
|
6883
|
6884
|
6885
|
6886
|
6898
|
6899
|
6900
|
6901
| 6913 |
6922
|
6928