Skip to content

Commit

Permalink
version 1.1 stable
Browse files Browse the repository at this point in the history
  • Loading branch information
mazaheriMahdi committed Feb 23, 2023
1 parent 4a95795 commit 9de411f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.idea/

.venv
data.txt
17 changes: 10 additions & 7 deletions RepoMenuItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ def __init__(self, link, text, is_sub=False):
self.set_callback(self.goTolink)
if not is_sub:
data = GetData()
for i in data.getRepoContent(name=self.text.strip()):
newMenu = MenuItem(link=i.href, text=i.title, is_sub=True)
if i.type == "Directory":
newMenu.icon = "folder.png"
else:
newMenu.icon = "file.png"
self.add(newMenu)
repContent = data.getRepoContent(name=self.text.strip())
if repContent != "error":
for i in repContent:
newMenu = MenuItem(link=i.href, text=i.title, is_sub=True)
if i.type == "Directory":
newMenu.icon = "folder.png"
else:
newMenu.icon = "file.png"
self.add(newMenu)


def goTolink(self, _):
"""Open menu Item link in browser."""
Expand Down
5 changes: 3 additions & 2 deletions data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@

class GetUserName(rumps.Window):
"""A dialog which contain a text input for getting username"""

def __init__(self):
super().__init__("Your GitHub user name ", "Config")
self.icon = "gitIco.png"


class GetData():
"""Get data from Git"""

def __init__(self):
# chech if there is data file or not
if not self.isThereFile():
Expand Down Expand Up @@ -82,8 +84,7 @@ def getRepoContent(self, name):
soup = soup.findAll("div", role="row", class_="Box-row--focus-gray")

except:
rumps.alert("Network Error", "Check your network connection", ok=None, icon_path="gitIco.png")
return ["error"]
return "error"
finally:
list = []
for i in soup:
Expand Down
1 change: 1 addition & 0 deletions data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mazaheriMahdi
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
app=APP,
name="GitStray",
data_files=DATA_FILES,
version="1.1 beta",
version="1.1 stable",
author="mahdi mazaheri",
author_email="mahdi83mazaheri@gmail.com",
platforms=["OSX"],
Expand Down

0 comments on commit 9de411f

Please sign in to comment.