-
Notifications
You must be signed in to change notification settings - Fork 1
Sourcery refactored master branch #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,9 +70,9 @@ def main(): | |
| if filename not in svnignore_data: | ||
| continue | ||
| svnignore_data.remove(filename) | ||
| elif filename in svnignore_data: | ||
| continue | ||
| else: | ||
| if filename in svnignore_data: | ||
| continue | ||
|
Comment on lines
+73
to
-75
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| svnignore_data.append(filename) | ||
|
|
||
| # Optionally sort. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,20 +66,14 @@ def main(): | |
| args.files.append("-") | ||
|
|
||
| for arg in args.files: | ||
| if arg == "-": | ||
| text = sys.stdin.read() | ||
| else: | ||
| text = open(arg, "rb").read() | ||
| text = sys.stdin.read() if arg == "-" else open(arg, "rb").read() | ||
| utext = text.decode("utf8") | ||
| utext = unicodedata.normalize("NFKD", utext) | ||
| utext = utext.translate(XTABLE) | ||
| try: | ||
| utext.encode("ascii", "strict") | ||
| except UnicodeEncodeError as err: | ||
| if arg == "-": | ||
| errfile = "" | ||
| else: | ||
| errfile = "In '%s', " % arg | ||
| errfile = "" if arg == "-" else "In '%s', " % arg | ||
|
Comment on lines
-69
to
+76
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| sys.stderr.write( | ||
| "ERROR: %s%s\n" % (errfile, str(err)) | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,12 +136,11 @@ def clean_link(args, linkname, backup=True): | |
| os.unlink(link_pathname) | ||
|
|
||
| elif os.path.exists(link_pathname): | ||
| if os.path.isdir(link_pathname): | ||
| if not os.listdir(link_pathname): | ||
| print("Removing empty directory '{0}'.".format(link_pathname)) | ||
| if not args.dryrun: | ||
| os.rmdir(link_pathname) | ||
| return | ||
| if os.path.isdir(link_pathname) and not os.listdir(link_pathname): | ||
| print("Removing empty directory '{0}'.".format(link_pathname)) | ||
| if not args.dryrun: | ||
| os.rmdir(link_pathname) | ||
| return | ||
|
Comment on lines
-139
to
+143
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| # The destination exists as a file or dir. Back it up. | ||
| if backup: | ||
|
|
@@ -552,13 +551,13 @@ def xfwm4_remove_key_binding(args, binding): | |
| binding | ||
| ] | ||
| output = force_run_command(cmdargs) | ||
| if output.find("does not exist on channel") != -1: | ||
| if args.verbose: | ||
| print("Key binding '{0}' already removed.".format(binding)) | ||
| else: | ||
| if output.find("does not exist on channel") == -1: | ||
| print("Removing key binding '{0}'.".format(binding)) | ||
| run_command(args, cmdargs + ["--reset"]) | ||
|
|
||
| elif args.verbose: | ||
| print("Key binding '{0}' already removed.".format(binding)) | ||
|
Comment on lines
-555
to
+559
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
|
|
||
| def xfwm4_add_key_binding(args, binding, command): | ||
| """Add a xfwm4 key binding.""" | ||
|
|
@@ -850,10 +849,10 @@ def main(): | |
| args.is_cygwin = sys.platform == "cygwin" | ||
| args.is_windows = sys.platform.startswith("win") | ||
| args.is_xwindows = ( | ||
| exe_in_path("xterm") and | ||
| not (args.is_cygwin or args.is_windows) | ||
| exe_in_path("xterm") and not args.is_cygwin and not args.is_windows | ||
| ) | ||
|
|
||
|
Comment on lines
-853
to
854
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
| # Ensure that directories exist. | ||
| mkdir(args, True, args.cache_dir, 0o700) | ||
| mkdir(args, True, explicit_cache_dir, 0o700) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,8 +38,7 @@ def _history_pathname(): | |
| Default is ~/.python_history, but we are trying to cleanup the | ||
| user's home directory. | ||
| """ | ||
| pathname = os.path.join(xdg_cache_home, "python", "history") | ||
| return pathname | ||
| return os.path.join(xdg_cache_home, "python", "history") | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
|
|
||
| def _save_history(): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
ignore_filerefactored with the following changes:use-any)