allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 02/07: [#8368] Python3 migration changes.
Date Mon, 14 Jun 2021 20:51:38 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8368
in repository https://gitbox.apache.org/repos/asf/allura.git

commit b3ad3d81b407187a4206d8ec32d16d0e43496ed2
Author: Sanskriti Mohapatra <Sanskriti.Mohapatra@in.bosch.com>
AuthorDate: Thu Apr 15 11:45:53 2021 +0530

    [#8368] Python3 migration changes.
---
 ForgeFiles/forgefiles/files_main.py                 | 5 ++++-
 ForgeFiles/forgefiles/model/__init__.py             | 3 ++-
 ForgeFiles/forgefiles/model/files.py                | 4 +++-
 ForgeFiles/forgefiles/tests/functional/test_root.py | 6 +++++-
 ForgeFiles/forgefiles/tests/model/__init__.py       | 2 ++
 ForgeFiles/forgefiles/tests/model/test_files.py     | 2 ++
 ForgeFiles/forgefiles/tests/test_files_roles.py     | 2 ++
 ForgeFiles/setup.py                                 | 2 ++
 8 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ForgeFiles/forgefiles/files_main.py b/ForgeFiles/forgefiles/files_main.py
index 508e6f6..2b378bf 100755
--- a/ForgeFiles/forgefiles/files_main.py
+++ b/ForgeFiles/forgefiles/files_main.py
@@ -20,8 +20,10 @@
 
 #       !/bin/python
 
+from __future__ import unicode_literals
+from __future__ import absolute_import
 import logging
-from urllib import unquote
+from six.moves.urllib.parse import unquote
 
 from tg import config, redirect, expose, flash
 from tg.decorators import with_trailing_slash, without_trailing_slash
@@ -44,6 +46,7 @@ from webob import exc
 
 # local imports ##
 from forgefiles.model.files import UploadFolder, UploadFiles, Upload
+from six.moves import range
 
 log = logging.getLogger(__name__)
 
diff --git a/ForgeFiles/forgefiles/model/__init__.py b/ForgeFiles/forgefiles/model/__init__.py
index 8b738df..e6c6743 100755
--- a/ForgeFiles/forgefiles/model/__init__.py
+++ b/ForgeFiles/forgefiles/model/__init__.py
@@ -15,4 +15,5 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from files import UploadFolder, UploadFiles
+from __future__ import absolute_import
+from .files import UploadFolder, UploadFiles
diff --git a/ForgeFiles/forgefiles/model/files.py b/ForgeFiles/forgefiles/model/files.py
index 33062d0..c4c7bb9 100755
--- a/ForgeFiles/forgefiles/model/files.py
+++ b/ForgeFiles/forgefiles/model/files.py
@@ -17,9 +17,11 @@
 #       under the License.
 
 
+from __future__ import unicode_literals
+from __future__ import absolute_import
 from datetime import datetime
 
-from urllib import quote
+from six.moves.urllib.parse import quote
 import re
 
 from ming import schema as S
diff --git a/ForgeFiles/forgefiles/tests/functional/test_root.py b/ForgeFiles/forgefiles/tests/functional/test_root.py
index 569d8a7..fd3b057 100644
--- a/ForgeFiles/forgefiles/tests/functional/test_root.py
+++ b/ForgeFiles/forgefiles/tests/functional/test_root.py
@@ -14,6 +14,9 @@
 #       KIND, either express or implied.  See the License for the
 #       specific language governing permissions and limitations
 #       under the License.
+from __future__ import unicode_literals
+from __future__ import absolute_import
+from __future__ import print_function
 from tg import tmpl_context as c
 from nose.tools import assert_true,assert_not_equal,assert_equals
 
@@ -25,6 +28,7 @@ from forgefiles.model.files import UploadFolder
 from forgefiles.model.files import UploadFiles
 
 from testfixtures import TempDirectory
+from io import open
 
 
 class TestFiles(TestController):
@@ -77,7 +81,7 @@ class TestFiles(TestController):
         data1 = {'folder_id': str(folder_object._id), 'remarks': 'Publishing new Version'}
         self.app.post('/p/test/files/publish_folder', data1)
         resp = self.app.get('/files/')
-        print(folder_object.published)
+        print((folder_object.published))
         assert_equals(folder_object.published, True)
 
     def test_link_file(self):
diff --git a/ForgeFiles/forgefiles/tests/model/__init__.py b/ForgeFiles/forgefiles/tests/model/__init__.py
index b91b746..ca8d106 100644
--- a/ForgeFiles/forgefiles/tests/model/__init__.py
+++ b/ForgeFiles/forgefiles/tests/model/__init__.py
@@ -15,6 +15,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+from __future__ import unicode_literals
+from __future__ import absolute_import
 from tg import tmpl_context as c
 from ming.orm.ormsession import ThreadLocalORMSession
 
diff --git a/ForgeFiles/forgefiles/tests/model/test_files.py b/ForgeFiles/forgefiles/tests/model/test_files.py
index 6af03e2..9c236ec 100644
--- a/ForgeFiles/forgefiles/tests/model/test_files.py
+++ b/ForgeFiles/forgefiles/tests/model/test_files.py
@@ -16,6 +16,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+from __future__ import unicode_literals
+from __future__ import absolute_import
 from nose.tools import assert_equal, assert_true, assert_false
 
 from forgefiles.tests.model import FilesTestWithModel
diff --git a/ForgeFiles/forgefiles/tests/test_files_roles.py b/ForgeFiles/forgefiles/tests/test_files_roles.py
index 203f331..9998275 100644
--- a/ForgeFiles/forgefiles/tests/test_files_roles.py
+++ b/ForgeFiles/forgefiles/tests/test_files_roles.py
@@ -15,6 +15,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+from __future__ import unicode_literals
+from __future__ import absolute_import
 from nose.tools import assert_equal
 from tg import tmpl_context as c, app_globals as g
 
diff --git a/ForgeFiles/setup.py b/ForgeFiles/setup.py
index a3dbaa9..10fc045 100755
--- a/ForgeFiles/setup.py
+++ b/ForgeFiles/setup.py
@@ -16,6 +16,8 @@
 #       under the License.
 
 #       !/bin/python
+from __future__ import unicode_literals
+from __future__ import absolute_import
 from setuptools import setup
 
 setup(name='ForgeFiles',

Mime
View raw message