Skip to content

Conversation

@dry71
Copy link
Contributor

@dry71 dry71 commented Jul 17, 2021

Added a DataService file containing the BetterBotBaseDataService class

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2021

This pull request introduces 1 alert and fixes 1 when merging 843e465 into 96f579a - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2021

This pull request introduces 1 alert and fixes 1 when merging 8b44aa0 into 96f579a - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2021

This pull request introduces 2 alerts and fixes 1 when merging fca5eaf into 96f579a - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2021

This pull request introduces 2 alerts and fixes 1 when merging e428403 into 96f579a - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2021

This pull request introduces 3 alerts and fixes 1 when merging 8fd563c into 96f579a - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Missing call to `__init__` during object initialization
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 18, 2021

This pull request introduces 3 alerts and fixes 1 when merging 4363cb5 into 3f51487 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Missing call to `__init__` during object initialization
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 6, 2021

This pull request introduces 2 alerts and fixes 1 when merging ddb58ab into 3f51487 - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization
  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 6, 2021

This pull request introduces 1 alert and fixes 1 when merging e7c3746 into 3f51487 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 7, 2021

This pull request introduces 1 alert and fixes 1 when merging 79e0108 into 3f51487 - view on LGTM.com

new alerts:

  • 1 for Wrong number of arguments in a call

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2021

This pull request fixes 1 alert when merging 3cc0aec into 3f51487 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2021

This pull request fixes 1 alert when merging fee2c8a into 3f51487 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 8, 2021

This pull request fixes 1 alert when merging a05d7ff into c9cc5a0 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 21, 2021

This pull request fixes 1 alert when merging 337d689 into c9cc5a0 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Sep 11, 2021

This pull request fixes 1 alert when merging 8fbcdc2 into 85e996e - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Sep 11, 2021

This pull request fixes 1 alert when merging b725a75 into 85e996e - view on LGTM.com

fixed alerts:

  • 1 for Unused import

Comment on lines 269 to 275
def get_github_profile_string(self, user):
profile = self.data.get_user_property(user, "github_profile")
return f"github.com/{profile}" if profile else "отсутствует"

def get_github_profile_top_string(self, user):
profile = self.get_github_profile(user)
if profile:
profile = f" — github.com/{profile}"
return profile
profile = self.data.get_user_property(user, "github_profile")
return f" — github.com/{profile}" if profile else ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_github_profile_string(self, user):
profile = self.data.get_user_property(user, "github_profile")
return f"github.com/{profile}" if profile else "отсутствует"
def get_github_profile_top_string(self, user):
profile = self.get_github_profile(user)
if profile:
profile = f" — github.com/{profile}"
return profile
profile = self.data.get_user_property(user, "github_profile")
return f" — github.com/{profile}" if profile else ""
def get_github_profile_or_default(self, user, default="", prefix=""):
profile = self.data.get_user_property(user, "github_profile")
return f"{prefix}github.com/{profile}" if profile else default

Comment on lines 250 to 256
self.data.set_user_property(user, "karma", self.data.get_user_property(user, "karma") + amount)
initial_karma = self.data.get_user_property(user, "karma"),
self.data.set_user_property(user, "karma", initial_karma + amount)
return (user.uid,
self.data.get_user_property(user, "name"),
initial_karma,
self.data.get_user_property(user, "karma"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.data.set_user_property(user, "karma", self.data.get_user_property(user, "karma") + amount)
initial_karma = self.data.get_user_property(user, "karma"),
self.data.set_user_property(user, "karma", initial_karma + amount)
return (user.uid,
self.data.get_user_property(user, "name"),
initial_karma,
self.data.get_user_property(user, "karma"))
initial_karma = self.data.get_user_property(user, "karma"),
new_karma = initial_karma + amount;
self.data.set_user_property(user, "karma", new_karma)
return (user.uid,
self.data.get_user_property(user, "name"),
initial_karma,
new_karma)

Comment on lines 23 to 30
def get_users_sorted_by_keys(self, other_keys, sort_key=None):
users = self.base.getByKeys(*other_keys)
sorted_users = sorted(
users,
key=sort_key,
reverse=True
)
return sorted_users
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_users_sorted_by_keys(self, other_keys, sort_key=None):
users = self.base.getByKeys(*other_keys)
sorted_users = sorted(
users,
key=sort_key,
reverse=True
)
return sorted_users
def get_users(self, other_keys, sort_key=None):
users = self.base.getByKeys(*other_keys)
if sort_key is not None:
users = sorted(
users,
key=sort_key,
reverse=True
)
return users

Comment on lines 17 to 21
def get_user_sorted_programming_languages(self, user):
languages = self.get_user_property(user, "programming_languages")
languages = languages if type(languages) == list else []
languages.sort()
return languages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_user_sorted_programming_languages(self, user):
languages = self.get_user_property(user, "programming_languages")
languages = languages if type(languages) == list else []
languages.sort()
return languages
def get_user_programming_languages(self, user, sort=True):
languages = self.get_user_property(user, "programming_languages")
languages = languages if type(languages) == list else []
if sort:
languages.sort()
return languages

@lgtm-com
Copy link

lgtm-com bot commented Dec 1, 2021

This pull request fixes 1 alert when merging 6552f9b into c021e09 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Dec 1, 2021

This pull request fixes 1 alert when merging b676737 into c021e09 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Dec 1, 2021

This pull request fixes 1 alert when merging a662989 into c021e09 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@konard konard linked an issue Dec 2, 2021 that may be closed by this pull request
@konard konard merged commit 9f51b92 into master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split data layer to separate class

4 participants