Skip to content

Commit

Permalink
Address flake8 hints
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Mar 29, 2019
1 parent 2b4f18e commit a8fb1c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def base_activity():
activity['timestamps'] = {'start': start_time}
return activity


# List of icon names that are also language names.
AVAILABLES_ICONS = {
'c',
Expand Down Expand Up @@ -62,6 +63,7 @@ def base_activity():
'html.markdown': 'markdown',
}


def get_icon(main_scope):
base_scope, sub_scope = main_scope.split('.', 1)
icon = 'text' if base_scope == 'text' else 'unknown'
Expand All @@ -76,12 +78,14 @@ def get_icon(main_scope):
logger.debug('Using icon "%s" for scope "%s"', icon, main_scope)
return 'lang-%s' % icon


def yield_subscopes(scope):
last_dot = len(scope)
while last_dot > 0:
yield scope[:last_dot]
last_dot = scope[:last_dot].rfind('.')


def sizehf(num):
for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
if abs(num) < 1024.0:
Expand Down Expand Up @@ -115,7 +119,7 @@ def handle_activity(view, is_write=False):
project=get_project_name(window, entity),
size=view.size(),
sizehf=sizehf(view.size()),
loc=view.rowcol(view.size())[0]+1,
loc=view.rowcol(view.size())[0] + 1,
folders=len(window.folders()),
)
last_file = entity
Expand Down

0 comments on commit a8fb1c5

Please sign in to comment.