Преглед на файлове

Clean up imports

manifest_xml: import `HEAD` and `R_HEADS` from correct module
version: import `HEAD` from correct module

`HEAD` and `R_HEADS` should be imported from the git_refs module,
where they are originally defined, rather than from the project
module.

repo: remove unused import of readline

cherry_pick: import standard modules on separate lines
smartsync: import subcmd modules explicitly from subcmd

Use:
  `import re
  import sys`
and
  `from subcmds.sync import Sync`

Instead of:
  `import sys, re`
and
  `from sync import Sync`

Change-Id: Ie10dd6832710939634c4f5c86b9ba5a9cd6fc92e
David Pursehouse преди 13 години
родител
ревизия
e00aa6b923
променени са 5 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. 2 1
      manifest_xml.py
  2. 0 1
      repo
  3. 2 1
      subcmds/cherry_pick.py
  4. 1 1
      subcmds/smartsync.py
  5. 1 1
      subcmds/version.py

+ 2 - 1
manifest_xml.py

@@ -21,7 +21,8 @@ import urlparse
 import xml.dom.minidom
 
 from git_config import GitConfig
-from project import RemoteSpec, Project, MetaProject, R_HEADS, HEAD
+from git_refs import R_HEADS, HEAD
+from project import RemoteSpec, Project, MetaProject
 from error import ManifestParseError
 
 MANIFEST_FILE_NAME = 'manifest.xml'

+ 0 - 1
repo

@@ -88,7 +88,6 @@ REPO_MAIN = S_repo + '/main.py' # main script
 import optparse
 import os
 import re
-import readline
 import subprocess
 import sys
 import urllib2

+ 2 - 1
subcmds/cherry_pick.py

@@ -13,7 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import sys, re
+import re
+import sys
 from command import Command
 from git_command import GitCommand
 

+ 1 - 1
subcmds/smartsync.py

@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from sync import Sync
+from subcmds.sync import Sync
 
 class Smartsync(Sync):
   common = True

+ 1 - 1
subcmds/version.py

@@ -16,7 +16,7 @@
 import sys
 from command import Command, MirrorSafeCommand
 from git_command import git
-from project import HEAD
+from git_refs import HEAD
 
 class Version(Command, MirrorSafeCommand):
   wrapper_version = None