Skip to content

Commit c43017d

Browse files
authored
Merge pull request #107 from MightyCreak/cleaning
Some tiny cleanings
2 parents 46081e4 + 56b75f4 commit c43017d

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
root = true
22

33
[*]
4+
charset = utf-8
5+
end_of_line = lf
46
indent_style = space
57
indent_size = 4
6-
charset = utf-8
7-
trim_trailing_whitespace = true
88
insert_final_newline = true
9-
end_of_line = lf
9+
trim_trailing_whitespace = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false

src/main.py

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8142,7 +8142,8 @@ def main():
81428142

81438143
if argc == 2 and args[1] in [ '-v', '--version' ]:
81448144
print('%s %s\n%s' % (constants.APP_NAME, constants.VERSION, constants.COPYRIGHT))
8145-
sys.exit(0)
8145+
return 0
8146+
81468147
if argc == 2 and args[1] in [ '-h', '-?', '--help' ]:
81478148
print(_('''Usage:
81488149
diffuse [ [OPTION...] [FILE...] ]...
@@ -8181,22 +8182,27 @@ def main():
81818182
( -E | --ignore-end-of-line ) Ignore end of line differences
81828183
( -i | --ignore-case ) Ignore case differences
81838184
( -w | --ignore-all-space ) Ignore white space differences'''))
8184-
sys.exit(0)
8185+
return 0
81858186

81868187
# find the config directory and create it if it didn't exist
8187-
rc_dir, subdirs = os.environ.get('XDG_CONFIG_HOME', None), ['diffuse']
8188+
rc_dir = os.environ.get('XDG_CONFIG_HOME', None)
8189+
subdirs = ['diffuse']
81888190
if rc_dir is None:
81898191
rc_dir = os.path.expanduser('~')
81908192
subdirs.insert(0, '.config')
81918193
rc_dir = utils.make_subdirs(rc_dir, subdirs)
8194+
81928195
# find the local data directory and create it if it didn't exist
8193-
data_dir, subdirs = os.environ.get('XDG_DATA_HOME', None), ['diffuse']
8196+
data_dir = os.environ.get('XDG_DATA_HOME', None)
8197+
subdirs = ['diffuse']
81948198
if data_dir is None:
81958199
data_dir = os.path.expanduser('~')
81968200
subdirs[:0] = [ '.local', 'share' ]
81978201
data_dir = utils.make_subdirs(data_dir, subdirs)
8202+
81988203
# load resource files
8199-
i, rc_files = 1, []
8204+
i = 1
8205+
rc_files = []
82008206
if i < argc and args[i] == '--no-rcfile':
82018207
i += 1
82028208
elif i + 1 < argc and args[i] == '--rcfile':
@@ -8230,13 +8236,20 @@ def main():
82308236
diff.loadState(statepath)
82318237

82328238
# process remaining command line arguments
8233-
encoding, revs, close_on_same = None, [], False
8234-
specs, had_specs, labels = [], False, []
8235-
funcs = { 'modified': diff.createModifiedFileTabs,
8236-
'commit': diff.createCommitFileTabs,
8237-
'separate': diff.createSeparateTabs,
8238-
'single': diff.createSingleTab }
8239-
mode, options = 'single', {}
8239+
encoding = None
8240+
revs = []
8241+
close_on_same = False
8242+
specs = []
8243+
had_specs = False
8244+
labels = []
8245+
funcs = {
8246+
'modified': diff.createModifiedFileTabs,
8247+
'commit': diff.createCommitFileTabs,
8248+
'separate': diff.createSeparateTabs,
8249+
'single': diff.createSingleTab
8250+
}
8251+
mode = 'single'
8252+
options = {}
82408253
while i < argc:
82418254
arg = args[i]
82428255
if len(arg) > 0 and arg[0] == '-':

0 commit comments

Comments
 (0)