Skip to content

Commit 6840de6

Browse files
committed
all: move to google.cloud namespace
To ensure publishing and importing as from google.cloud.sqlcommenter import
1 parent 079fb07 commit 6840de6

27 files changed

Lines changed: 61 additions & 65 deletions

python/sqlcommenter-python/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Add the provided Django middleware to your Django project's settings. All querie
2626

2727
```python
2828
MIDDLEWARE = [
29-
'sqlcommenter.django.middleware.SqlCommenter',
29+
'google.sqlcommenter.django.middleware.SqlCommenter',
3030
...
3131
]
3232
```
@@ -41,7 +41,7 @@ which when viewed say on Postgresql logs, produces
4141
If you want the opencensus attributes included, you must set the
4242
``SQLCOMMENTER_WITH_OPENCENSUS`` setting to ``True`` and include
4343
``'opencensus.ext.django.middleware.OpencensusMiddleware'`` before
44-
``'sqlcommenter.django.middleware.SqlCommenter',`` in your ``MIDDLEWARE``
44+
``'google.sqlcommenter.django.middleware.SqlCommenter',`` in your ``MIDDLEWARE``
4545
setting.
4646

4747
### SQLAlchemy
@@ -50,7 +50,7 @@ Attach the provided event listener to the `before_cursor_execute` event of the d
5050

5151
```python
5252
import sqlalchemy
53-
from sqlcommenter.sqlalchemy.executor import BeforeExecuteFactory
53+
from google.sqlcommenter.sqlalchemy.executor import BeforeExecuteFactory
5454

5555
engine = sqlalchemy.create_engine(...)
5656
listener = BeforeExecuteFactory(with_db_driver=True, with_db_framework=True, with_opencensus=True)
@@ -72,7 +72,7 @@ Use the provided cursor factory to generate database cursors. All queries execut
7272

7373
```python
7474
import psycopg2
75-
from sqlcommenter.psycopg2.extension import CommenterCursorFactory
75+
from google.sqlcommenter.psycopg2.extension import CommenterCursorFactory
7676

7777
cursor_factory = CommenterCursorFactory(
7878
with_db_driver=True, with_dbapi_level=True, with_dbapi_threadsafety=True,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/python
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/python
2+
#
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.

python/sqlcommenter-python/sqlcommenter/__init__.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/__init__.py

File renamed without changes.

python/sqlcommenter-python/sqlcommenter/django/__init__.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/django/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16-

python/sqlcommenter-python/sqlcommenter/django/middleware.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/django/middleware.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
import django
1818
from django.db import connection
1919
from django.db.backends.utils import CursorDebugWrapper
20-
21-
from sqlcommenter import generate_sql_comment
22-
from sqlcommenter.opencensus import get_opencensus_values
20+
from google.cloud.sqlcommenter import generate_sql_comment
21+
from google.cloud.sqlcommenter.opencensus import get_opencensus_values
2322

2423
django_version = django.get_version()
2524

python/sqlcommenter-python/sqlcommenter/flask.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/flask.py

File renamed without changes.

python/sqlcommenter-python/sqlcommenter/opencensus.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/opencensus.py

File renamed without changes.

python/sqlcommenter-python/sqlcommenter/psycopg2/__init__.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/psycopg2/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16-

python/sqlcommenter-python/sqlcommenter/psycopg2/extension.py renamed to python/sqlcommenter-python/google/cloud/sqlcommenter/psycopg2/extension.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616

1717
import psycopg2
1818
import psycopg2.extensions
19-
20-
from sqlcommenter import generate_sql_comment
21-
from sqlcommenter.flask import get_flask_info
22-
from sqlcommenter.opencensus import get_opencensus_values
19+
from google.cloud.sqlcommenter import generate_sql_comment
20+
from google.cloud.sqlcommenter.flask import get_flask_info
21+
from google.cloud.sqlcommenter.opencensus import get_opencensus_values
2322

2423

2524
# This integration extends psycopg2.extensions.cursor

0 commit comments

Comments
 (0)