Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86ad56d

Browse files
committed
Add isort to sort Python imports
1 parent c6a574d commit 86ad56d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+443
-309
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
*.pub
77
*.DS_Store
88
dxtools.conf
9+
.tox/

.isort.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
force_single_line=True
3+
known_first_party=delphixpy,lib
4+
default_section=THIRDPARTY

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- repo: https://github.com/timothycrosley/isort
2+
rev: 4.3.21
3+
hooks:
4+
- id: isort

README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,35 @@ really awesome.
4343

4444
## Contribute
4545

46-
All contributors are required to sign the Delphix Contributor Agreement prior to contributing code to an open source
47-
repository. This process is handled automatically by [cla-assistant](https://cla-assistant.io/). Simply open a pull
48-
request and a bot will automatically check to see if you have signed the latest agreement. If not, you will be prompted
49-
to do so as part of the pull request process.
50-
51-
This project operates under the [Delphix Code of Conduct](https://delphix.github.io/code-of-conduct.html). By
46+
All contributors are required to sign the Delphix Contributor
47+
Agreement prior to contributing code to an open source
48+
repository. This process is handled automatically by
49+
[cla-assistant](https://cla-assistant.io/). Simply open a pull request
50+
and a bot will automatically check to see if you have signed the
51+
latest agreement. If not, you will be prompted to do so as part of the
52+
pull request process.
53+
54+
This project operates under the [Delphix Code of
55+
Conduct](https://delphix.github.io/code-of-conduct.html). By
5256
participating in this project you agree to abide by its terms.
5357

58+
### Formatting
59+
60+
This repository uses the `tox` and `pre-commit` tools to run
61+
autoformatters on the entire repository. These two tools are the
62+
industry standard for Python. The goal of these formatters is to
63+
delegate issues of formatting to the machine so that develeopers and
64+
code-reviewers can focus on more important things.
65+
5466
## Statement of Support
5567

56-
This software is provided as-is, without warranty of any kind or commercial support through Delphix. See the associated
57-
license for additional details. Questions, issues, feature requests, and contributions should be directed to the
58-
community as outlined in the [Delphix Community Guidelines](https://delphix.github.io/community-guidelines.html).
68+
This software is provided as-is, without warranty of any kind or
69+
commercial support through Delphix. See the associated license for
70+
additional details. Questions, issues, feature requests, and
71+
contributions should be directed to the community as outlined in the
72+
[Delphix Community
73+
Guidelines](https://delphix.github.io/community-guidelines.html).
5974

6075
## License
6176

6277
This is code is licensed under the Apache License 2.0. Full license is available [here](./LICENSE).
63-

add_windows_env.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55

66
from delphixpy.delphix_engine import DelphixEngine
77
from delphixpy.web import environment
8-
from delphixpy.web.vo import HostEnvironmentCreateParameters, EnvironmentUser, PasswordCredential, \
9-
WindowsHostEnvironment, WindowsHostCreateParameters, WindowsHost
8+
from delphixpy.web.vo import EnvironmentUser
9+
from delphixpy.web.vo import HostEnvironmentCreateParameters
10+
from delphixpy.web.vo import PasswordCredential
11+
from delphixpy.web.vo import WindowsHost
12+
from delphixpy.web.vo import WindowsHostCreateParameters
13+
from delphixpy.web.vo import WindowsHostEnvironment
1014

1115
engine_address = "192.168.2.37"
1216
engine_username = "delphix_admin"

delphix_admin_setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99

1010
import getopt
1111
import logging
12-
from os.path import basename
1312
import signal
1413
import sys
1514
import time
1615
import traceback
16+
from os.path import basename
1717

1818
from delphixpy.v1_6_0.delphix_engine import DelphixEngine
19-
from delphixpy.v1_6_0.exceptions import HttpError, JobError
19+
from delphixpy.v1_6_0.exceptions import HttpError
20+
from delphixpy.v1_6_0.exceptions import JobError
2021
from delphixpy.v1_6_0.web import user
21-
from delphixpy.v1_6_0.web.vo import CredentialUpdateParameters, PasswordCredential, User
22+
from delphixpy.v1_6_0.web.vo import CredentialUpdateParameters
23+
from delphixpy.v1_6_0.web.vo import PasswordCredential
24+
from delphixpy.v1_6_0.web.vo import User
2225

2326

2427
def serversess(f_engine_address, f_engine_username, f_engine_password):

delphix_snapshot_group_will_plugin.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22
#For use with HipChat and Will
33
#https://github.com/skoczen/will
44

5+
from will.decorators import hear
6+
from will.decorators import periodic
7+
from will.decorators import randomly
8+
from will.decorators import rendered_template
9+
from will.decorators import require_settings
10+
from will.decorators import respond_to
11+
from will.decorators import route
512
from will.plugin import WillPlugin
6-
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
7-
from delphixpy.v1_6_0.delphix_engine import DelphixEngine
8-
from delphixpy.v1_6_0.web import group, database
13+
914
from delphixpy.v1_6_0 import job_context
15+
from delphixpy.v1_6_0.delphix_engine import DelphixEngine
16+
from delphixpy.v1_6_0.web import database
17+
from delphixpy.v1_6_0.web import group
18+
1019

1120
class DelphixSnapshotPlugin(WillPlugin):
1221

delphix_will_plugin.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@
22
#For use with HipChat and Will
33
#https://github.com/skoczen/will
44

5+
import imp
6+
import shlex
7+
import subprocess
8+
9+
from will.decorators import hear
10+
from will.decorators import periodic
11+
from will.decorators import randomly
12+
from will.decorators import rendered_template
13+
from will.decorators import require_settings
14+
from will.decorators import respond_to
15+
from will.decorators import route
516
from will.plugin import WillPlugin
6-
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
17+
718
from delphixpy.v1_6_0.delphix_engine import DelphixEngine
819
from delphixpy.v1_6_0.web import database
9-
import imp, subprocess, shlex
1020

1121
VERSION=0.001
1222

dx_authorization.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,33 @@
4747

4848
VERSION = 'v.0.0.015'
4949

50-
from docopt import docopt
51-
from os.path import basename
5250
import sys
53-
from time import sleep, time
5451
import traceback
52+
from os.path import basename
53+
from time import sleep
54+
from time import time
5555

56+
from docopt import docopt
57+
58+
from delphixpy.v1_8_0.exceptions import HttpError
5659
from delphixpy.v1_8_0.exceptions import JobError
5760
from delphixpy.v1_8_0.exceptions import RequestError
58-
from delphixpy.v1_8_0.exceptions import HttpError
61+
from delphixpy.v1_8_0.web import authorization
5962
from delphixpy.v1_8_0.web import database
63+
from delphixpy.v1_8_0.web import group
6064
from delphixpy.v1_8_0.web import job
6165
from delphixpy.v1_8_0.web import role
62-
from delphixpy.v1_8_0.web import authorization
63-
from delphixpy.v1_8_0.web import user
6466
from delphixpy.v1_8_0.web import snapshot
65-
from delphixpy.v1_8_0.web import group
66-
from delphixpy.v1_8_0.web.vo import User
67+
from delphixpy.v1_8_0.web import user
6768
from delphixpy.v1_8_0.web.vo import Authorization
68-
69+
from delphixpy.v1_8_0.web.vo import User
6970
from lib.DlpxException import DlpxException
70-
from lib.GetSession import GetSession
71-
from lib.GetReferences import find_obj_by_name
7271
from lib.DxLogging import logging_est
73-
from lib.DxLogging import print_info
7472
from lib.DxLogging import print_debug
7573
from lib.DxLogging import print_exception
74+
from lib.DxLogging import print_info
75+
from lib.GetReferences import find_obj_by_name
76+
from lib.GetSession import GetSession
7677

7778

7879
def create_authorization(dlpx_obj, role_name, target_type, target_name,
@@ -444,4 +445,4 @@ def main():
444445
arguments = docopt(__doc__, version=basename(__file__) + " " + VERSION)
445446

446447
# Feed our arguments to the main function, and off we go!
447-
main()
448+
main()

dx_delete_vdb.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,33 @@
5757
VERSION="v.0.0.001"
5858

5959

60-
from docopt import docopt
60+
import json
6161
import logging
62-
from os.path import basename
6362
import signal
6463
import sys
6564
import time
6665
import traceback
67-
import json
68-
6966
from multiprocessing import Process
70-
from time import sleep, time
67+
from os.path import basename
68+
from time import sleep
69+
from time import time
70+
71+
from docopt import docopt
7172

72-
from delphixpy.v1_6_0.delphix_engine import DelphixEngine
73-
from delphixpy.v1_6_0.exceptions import HttpError, JobError
7473
from delphixpy.v1_6_0 import job_context
75-
from delphixpy.v1_6_0.web import database, environment, group, job, source, user
76-
from delphixpy.v1_6_0.web.vo import ASESpecificBackupSyncParameters, ASENewBackupSyncParameters, ASELatestBackupSyncParameters, MSSqlSyncParameters
74+
from delphixpy.v1_6_0.delphix_engine import DelphixEngine
75+
from delphixpy.v1_6_0.exceptions import HttpError
76+
from delphixpy.v1_6_0.exceptions import JobError
77+
from delphixpy.v1_6_0.web import database
78+
from delphixpy.v1_6_0.web import environment
79+
from delphixpy.v1_6_0.web import group
80+
from delphixpy.v1_6_0.web import job
81+
from delphixpy.v1_6_0.web import source
82+
from delphixpy.v1_6_0.web import user
83+
from delphixpy.v1_6_0.web.vo import ASELatestBackupSyncParameters
84+
from delphixpy.v1_6_0.web.vo import ASENewBackupSyncParameters
85+
from delphixpy.v1_6_0.web.vo import ASESpecificBackupSyncParameters
86+
from delphixpy.v1_6_0.web.vo import MSSqlSyncParameters
7787

7888

7989
def find_obj_by_name(engine, server, f_class, obj_name):
@@ -570,4 +580,4 @@ def main(argv):
570580
sys.exit()
571581
#Feed our arguments to the main function, and off we go!
572582
print arguments
573-
main(arguments)
583+
main(arguments)

0 commit comments

Comments
 (0)