Skip to content
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

[pull] master from UsergeTeam:master #107

Merged
merged 2 commits into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ dmypy.json
.pyre/

# config files
.apt/
.heroku/
.profile.d/
vendor/
config.ini
config.env
.vscode/
Expand Down
6 changes: 6 additions & 0 deletions userge/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ class Config:
logbot.del_last_msg()


for ref in _REPO.remote(Config.UPSTREAM_REMOTE).refs:
branch = str(ref).split('/')[-1]
if branch not in _REPO.branches:
_REPO.create_head(branch, ref)


def get_version() -> str:
""" get userge version """
ver = f"{versions.__major__}.{versions.__minor__}.{versions.__micro__}"
Expand Down
7 changes: 1 addition & 6 deletions userge/plugins/tools/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ async def check_update(message: Message):
""" check or do updates """
await message.edit("`Checking for updates, please wait....`")
repo = Repo()
ups_rem = repo.remote(Config.UPSTREAM_REMOTE)
try:
ups_rem.fetch()
repo.remote(Config.UPSTREAM_REMOTE).fetch()
except GitCommandError as error:
await message.err(error, del_in=5)
return
for ref in ups_rem.refs:
branch = str(ref).split('/')[-1]
if branch not in repo.branches:
repo.create_head(branch, ref)
flags = list(message.flags)
pull_from_repo = False
push_to_heroku = False
Expand Down
2 changes: 1 addition & 1 deletion userge/plugins/utils/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
CHANNEL = userge.getCLogger(__name__)

FILTERS_DATA: Dict[int, Dict[str, int]] = {}
FILTERS_CHATS = filters.create(lambda _, __, query: query.chat.id in FILTERS_DATA)
FILTERS_CHATS = filters.create(lambda _, __, query: query.chat and query.chat.id in FILTERS_DATA)

_SUPPORTED_TYPES = (":audio:", ":video:", ":photo:", ":document:",
":sticker:", ":animation:", ":voice:", ":video_note:",
Expand Down
2 changes: 1 addition & 1 deletion userge/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

__major__ = 0
__minor__ = 2
__micro__ = 0
__micro__ = 1

__python_version__ = f"{version_info[0]}.{version_info[1]}.{version_info[2]}"
__license__ = "[GNU GPL v3.0](https://github.com/UsergeTeam/Userge/blob/master/LICENSE)"
Expand Down