Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 52b495d

Browse files
Merge pull request avinashkranjan#2787 from avinashkranjan/deepsource-transform-ab794a41
format code with autopep8
2 parents ae4b8d0 + 7c51d3f commit 52b495d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

‎SSH_Host_Script/SSH_Host_Script.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,33 @@
88
Port {port}
99
"""
1010

11+
1112
def args_to_obj(args):
1213
return SSH_TEMPLATE.format(**args.__dict__)
1314

15+
1416
def add_to_conf(conf, obj):
1517
conf = os.path.expanduser(conf)
1618
with open(conf, 'a') as f:
1719
f.write(obj)
1820

21+
1922
def main():
20-
parser = argparse.ArgumentParser(prog="Adds ssh hosts to the ssh config file.")
23+
parser = argparse.ArgumentParser(
24+
prog="Adds ssh hosts to the ssh config file.")
2125
parser.add_argument('name', help="Name of the Host to add to the config.")
2226
parser.add_argument('hostname', help="Hostname/IP address of the host.")
23-
parser.add_argument('--user', default='root', help="The user to connect with. Defaults to root.")
24-
parser.add_argument('--port', default=22, type=int, help="The port to connect to. Defaults to 22.")
25-
parser.add_argument('--conf', default='~/.ssh/config', help="The path to the ssh config file. Defaults to ~/.ssh/config.")
27+
parser.add_argument('--user', default='root',
28+
help="The user to connect with. Defaults to root.")
29+
parser.add_argument('--port', default=22, type=int,
30+
help="The port to connect to. Defaults to 22.")
31+
parser.add_argument('--conf', default='~/.ssh/config',
32+
help="The path to the ssh config file. Defaults to ~/.ssh/config.")
2633

2734
args = parser.parse_args()
2835
obj = args_to_obj(args)
2936
add_to_conf(args.conf, obj)
3037

38+
3139
if __name__ == '__main__':
3240
main()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /