Skip to content

Commit

Permalink
lint - kamangir/bolt#1234
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Feb 18, 2024
1 parent 6354395 commit 3303832
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
pylint -d W1203,C0103,C0114,C0115 $(git ls-files '*.py')
pylint -d W1203,C0103,C0114,C0115,C0116 $(git ls-files '*.py')
2 changes: 1 addition & 1 deletion abcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

NAME = "abcli"

VERSION = "7.2695.1"
VERSION = "7.2697.1"

DESCRIPTION = "🚀 a language to speak AI."

Expand Down
3 changes: 0 additions & 3 deletions abcli/bash/help.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"""used by "abcli help"
"""

from functools import reduce
from abcli import file

Expand Down
2 changes: 0 additions & 2 deletions abcli/bash/list/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""list functions used in bash"""

NAME = "abcli.bash.list"
2 changes: 0 additions & 2 deletions abcli/bash/list/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"""list functions used in bash"""

import argparse
from . import NAME

Expand Down
2 changes: 0 additions & 2 deletions abcli/file/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"""file interface"""

NAME = "abcli.file"

# pylint: disable=wrong-import-position
Expand Down
2 changes: 0 additions & 2 deletions abcli/file/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"""file interface"""

import argparse
from abcli import string, NAME
from abcli.file import size
Expand Down
1 change: 1 addition & 0 deletions abcli/file/classes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import json


# https://gist.github.com/jsbueno/9b2ea63fb16b84658281ec29b375283e
class JsonEncoder(json.JSONEncoder):
def default(self, obj):
Expand Down
49 changes: 26 additions & 23 deletions abcli/timer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import time
from abcli import string
from abcli import logging
import logging

logger = logging.getLogger(__name__)
from abcli.logging import logger


class Timer(object):
Expand All @@ -25,31 +22,37 @@ def signature(self):

return "{}:{}/{}~{}".format(
self.name,
"?"
if since is None
else string.pretty_duration(
since,
largest=True,
short=True,
)
if since < self.period / 2
else string.pretty_duration(
-(self.period - since),
largest=True,
short=True,
(
"?"
if since is None
else (
string.pretty_duration(
since,
largest=True,
short=True,
)
if since < self.period / 2
else string.pretty_duration(
-(self.period - since),
largest=True,
short=True,
)
)
),
string.pretty_duration(
self.period,
largest=True,
short=True,
),
string.pretty_duration(
(current_time - self.start_time) / self.count,
largest=True,
short=True,
)
if self.count
else "?",
(
string.pretty_duration(
(current_time - self.start_time) / self.count,
largest=True,
short=True,
)
if self.count
else "?"
),
)

def tick(self, wait=False):
Expand Down

0 comments on commit 3303832

Please sign in to comment.