Fix .py files 18/49318/1
authorUmesh Singla <umeshksingla@gmail.com>
Tue, 13 Dec 2016 19:07:58 +0000 (00:37 +0530)
committerUmesh Singla <umeshksingla@gmail.com>
Tue, 13 Dec 2016 19:07:58 +0000 (00:37 +0530)
Fix/lint .py files according to PEP8, using coala

Change-Id: I63e6e3b3c62cd3737e1978d8be11b7f9e5dbbc9b
Signed-off-by: Umesh Singla <umeshksingla@gmail.com>
deb/build.py
deb/templates/build_debianfiles.py
docs/conf.py
rpm/build.py
tutorials/l2switch/mininet.py

index ca103ca4dc70140c1452ad5c5e9ee003e5fc6abf..cf1dd443d6d7d3316489f94b326feadd318b8c44 100755 (executable)
@@ -19,7 +19,8 @@ import cache.cache as cache
 import templates.build_debianfiles as build_debfiles
 
 # Common paths used in this script
-# This file is assumed to be in the root of the .deb build logic's dir structure
+# This file is assumed to be in the root of the .deb build logic's dir
+# structure
 project_root = os.path.dirname(os.path.abspath(__file__))
 
 # Cache directory for OpenDaylight's release tarball
@@ -58,7 +59,8 @@ def build_deb(build):
 
     # Build debian package
     os.chdir(odl_dir_path)
-    subprocess.call(["dpkg-buildpackage", "-us -uc -b", odl_dir_path], shell=True)
+    subprocess.call(["dpkg-buildpackage", "-us -uc -b",
+                     odl_dir_path], shell=True)
 
     # Install opendaylight's dependencies
     control_file_path = os.path.join(odl_dir_path, "debian/control")
@@ -85,18 +87,26 @@ if __name__ == "__main__":
         nargs="*", help="Deb version(s) to build"
     )
     new_build_group = parser.add_argument_group("New build")
-    new_build_group.add_argument("--major", help="Major (element) version to build")
+    new_build_group.add_argument(
+        "--major", help="Major (element) version to build")
     new_build_group.add_argument("--minor", help="Minor (SR) version to build")
     new_build_group.add_argument("--patch", help="Patch version to build")
     new_build_group.add_argument("--deb",   help="Deb version to build")
-    new_build_group.add_argument("--sysd_commit", help="Version of ODL unitfile to package")
+    new_build_group.add_argument(
+        "--sysd_commit", help="Version of ODL unitfile to package")
     new_build_group.add_argument("--codename", help="Codename for ODL version")
-    new_build_group.add_argument("--download_url", help="Tarball to repackage into .deb")
-    new_build_group.add_argument("--java_version", help="Java dependency for the ODL release")
-    new_build_group.add_argument("--changelog_date", help="Date this .deb was defined")
-    new_build_group.add_argument("--changelog_time", help="Time this .deb was defined")
-    new_build_group.add_argument("--changelog_name", help="Name of person who defined .deb")
-    new_build_group.add_argument("--changelog_email", help="Email of person who defined .deb")
+    new_build_group.add_argument(
+        "--download_url", help="Tarball to repackage into .deb")
+    new_build_group.add_argument(
+        "--java_version", help="Java dependency for the ODL release")
+    new_build_group.add_argument(
+        "--changelog_date", help="Date this .deb was defined")
+    new_build_group.add_argument(
+        "--changelog_time", help="Time this .deb was defined")
+    new_build_group.add_argument(
+        "--changelog_name", help="Name of person who defined .deb")
+    new_build_group.add_argument(
+        "--changelog_email", help="Email of person who defined .deb")
 
     # Print help if no arguments are given
     if len(sys.argv) == 1:
index 187dc97c88ade7a721da1ee7c8a6bbd803ab0f9e..39e65bef0c450eff7cacfa021e0e7266ae3efe04 100755 (executable)
@@ -21,13 +21,15 @@ debian_files_static = ["compat", "karaf", "opendaylight.install",
                        "opendaylight.postrm", "opendaylight.postinst",
                        "opendaylight.upstart"]
 
-# Path to the directory that contains this file is assumed to be the debian templates dir
+# Path to the directory that contains this file is assumed to be the
+# debian templates dir
 templates_dir = os.path.dirname(os.path.abspath(__file__))
 
 # Create the Jinja2 Environment
 env = Environment(loader=FileSystemLoader(templates_dir))
 
-# Python string Template, specialized into an Opendaylight directory name per-build
+# Python string Template, specialized into an Opendaylight directory name
+# per-build
 odl_dir_template = Template("opendaylight/opendaylight-$version_major.$version_minor."
                             "$version_patch-$pkg_version/")
 odl_deb_template = Template("opendaylight/opendaylight_$version_major.$version_minor."
index e250b223febf00c8df70a83726d25425285490bf..9c620face9d374753bffcacc74378de8526afca4 100644 (file)
@@ -208,17 +208,17 @@ htmlhelp_basename = 'IntegrationPackagingdoc'
 # -- Options for LaTeX output ---------------------------------------------
 
 latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+    # The paper size ('letterpaper' or 'a4paper').
+    #'papersize': 'letterpaper',
 
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
+    # The font size ('10pt', '11pt' or '12pt').
+    #'pointsize': '10pt',
 
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+    # Additional stuff for the LaTeX preamble.
+    #'preamble': '',
 
-# Latex figure (float) alignment
-#'figure_align': 'htbp',
+    # Latex figure (float) alignment
+    #'figure_align': 'htbp',
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
index 41e187d8a3db8bed7e4e38f890fd526f96ef5f08..3661d7b0337577cf14b4640c08f966136c6989e8 100755 (executable)
@@ -105,16 +105,22 @@ if __name__ == "__main__":
         nargs="*", help="RPM version(s) to build"
     )
     new_build_group = parser.add_argument_group("New build")
-    new_build_group.add_argument("--major", help="Major (element) version to build")
+    new_build_group.add_argument(
+        "--major", help="Major (element) version to build")
     new_build_group.add_argument("--minor", help="Minor (SR) version to build")
     new_build_group.add_argument("--patch", help="Patch version to build")
     new_build_group.add_argument("--rpm",   help="RPM version to build")
-    new_build_group.add_argument("--sysd_commit", help="Version of ODL unitfile to package")
+    new_build_group.add_argument(
+        "--sysd_commit", help="Version of ODL unitfile to package")
     new_build_group.add_argument("--codename", help="Codename for ODL version")
-    new_build_group.add_argument("--download_url", help="Tarball to repackage into RPM")
-    new_build_group.add_argument("--changelog_date", help="Date this RPM was defined")
-    new_build_group.add_argument("--changelog_name", help="Name of person who defined RPM")
-    new_build_group.add_argument("--changelog_email", help="Email of person who defined RPM")
+    new_build_group.add_argument(
+        "--download_url", help="Tarball to repackage into RPM")
+    new_build_group.add_argument(
+        "--changelog_date", help="Date this RPM was defined")
+    new_build_group.add_argument(
+        "--changelog_name", help="Name of person who defined RPM")
+    new_build_group.add_argument(
+        "--changelog_email", help="Email of person who defined RPM")
 
     # Print help if no arguments are given
     if len(sys.argv) == 1:
index 86fd9f0cd6899d79138b8b766455e2d2cf5b28ca..2e6717ea0de88a81cc71cef2a4e03172c9f0b90f 100755 (executable)
@@ -11,6 +11,7 @@ from mininet.node import RemoteController
 
 class SingleSwitchTopo(Topo):
     """Single switch connected to n hosts."""
+
     def build(self, n=2):
         switch = self.addSwitch("s1")
         # Python's range(N) generates 0..N-1
@@ -23,7 +24,8 @@ def simple_test():
     """Create and test a simple network."""
     topo = SingleSwitchTopo(n=4)
     net = Mininet(topo=topo, controller=None)
-    net.addController("c0", controller=RemoteController, ip="127.0.0.1", port=6633)
+    net.addController("c0", controller=RemoteController,
+                      ip="127.0.0.1", port=6633)
     net.start()
     time.sleep(10)
     print "Testing network connectivity"