Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
CorttChan committed Sep 25, 2022
2 parents 7a5e941 + 36d9da6 commit 707012a
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 124 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
description: 'Log level'
required: true
default: 'debug'
tags:
description: 'Test build release'
version:
description: 'release version'
required: true

# Workflow's jobs
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
run: |
pip install -r requirements-dev-msw.txt
echo ${{ github.ref }}
.\release\build-msw\build.bat v2.0.2
.\release\build-msw\build.bat ${{ github.event.inputs.version }}
# # step5: create release
# - name: release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: daily-test

on:
schedule:
- cron: '0 0 8 * *'
- cron: '0 8 * * *'

jobs:
test:
Expand Down
14 changes: 8 additions & 6 deletions archoctopus/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
APP_DISPLAY_NAME = "ArchOctopus -- 建筑师收集助手"

# URL常量
HOME_URL = "https://archoctopus.com/"
DONATE_URL = "https://archoctopus.com/donate/"
DONATION_URL = "https://archoctopus.com/sponsor/"
HELP_URL = "https://archoctopus.com/tutorials/"
FEEDBACK_URL = "https://archoctopus.com/feedback/"
HOME_URL = "https://archoctopus.cortt.me/"
DONATE_URL = "https://archoctopus.cortt.me/pages/donate.html"
DONATION_URL = "https://archoctopus.cortt.me/pages/sponsor.html"
HELP_URL = "https://archoctopus.cortt.me/pages/docs.html"
REPORT_URL = "https://archoctopus.cortt.me/pages/report.html"
FEEDBACK_URL = "https://archoctopus.cortt.me/pages/feedback.html"

GITEE_URL = "https://gitee.com/corttchan/ArchOctopus/"
GITHUB_URL = "https://github.com/CorttChan/ArchOctopus/"

LICENSE = "https://www.gnu.org/licenses/gpl-3.0.txt"

USAGE_API_URL = "https://archoctopus.com/api/usage.php"
# USAGE_API_URL = "https://archoctopus.com/api/usage.php"
USAGE_API_URL = "https://archoctopus.cortt.me/api/usage.php"
3 changes: 2 additions & 1 deletion archoctopus/gui/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
SYNC_DISABLE = "sync_disabled.svg"
SYNC_PROBLEM = "sync_problem.svg"

SETTINGS = "settings.svg"
SETTINGS = "tools.svg"
HISTORY = "history.svg"
REPORT = "report.svg"
DONATE = "recommend.svg"

ACCOUNT_CIRCLE = "account_circle.svg"
Expand Down
20 changes: 18 additions & 2 deletions archoctopus/gui/mac_gui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 1.0.4 on Wed Sep 14 22:50:59 2022
# generated by wxGlade 1.0.4 on Sat Sep 24 00:15:55 2022
#

import wx
Expand Down Expand Up @@ -58,29 +58,40 @@ def __init__(self, *args, **kwds):
sizer_28 = wx.BoxSizer(wx.VERTICAL)
sizer_25.Add(sizer_28, 0, wx.EXPAND, 0)

grid_sizer_1 = wx.GridSizer(1, 4, 0, 15)
grid_sizer_1 = wx.GridSizer(1, 5, 0, 15)
sizer_28.Add(grid_sizer_1, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 40)

self.sync_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(SYNC, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.sync_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.sync_btn.SetToolTip(u"同步")
self.sync_btn.SetBitmapCurrent(svg_bitmap(SYNC, 27, 27))
self.sync_btn.SetSize(self.sync_btn.GetBestSize())
grid_sizer_1.Add(self.sync_btn, 0, wx.ALIGN_CENTER, 0)

self.setup_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(SETTINGS, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.setup_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.setup_btn.SetToolTip(u"设置")
self.setup_btn.SetBitmapCurrent(svg_bitmap(SETTINGS, 27, 27))
self.setup_btn.SetSize(self.setup_btn.GetBestSize())
grid_sizer_1.Add(self.setup_btn, 0, wx.ALIGN_CENTER, 0)

self.history_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(HISTORY, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.history_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.history_btn.SetToolTip(u"历史")
self.history_btn.SetBitmapCurrent(svg_bitmap(HISTORY, 27, 27))
self.history_btn.SetSize(self.history_btn.GetBestSize())
grid_sizer_1.Add(self.history_btn, 0, wx.ALIGN_CENTER, 0)

self.report_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(REPORT, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.report_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.report_btn.SetToolTip(u"报告")
self.report_btn.SetBitmapCurrent(svg_bitmap(REPORT, 27, 27))
self.report_btn.SetSize(self.report_btn.GetBestSize())
grid_sizer_1.Add(self.report_btn, 0, wx.ALIGN_CENTER, 0)

self.donate_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(DONATE, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.donate_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.donate_btn.SetToolTip(u"赞助")
self.donate_btn.SetBitmapCurrent(svg_bitmap(DONATE, 27, 27))
self.donate_btn.SetSize(self.donate_btn.GetBestSize())
grid_sizer_1.Add(self.donate_btn, 0, wx.ALIGN_CENTER, 0)
Expand Down Expand Up @@ -167,6 +178,7 @@ def __init__(self, *args, **kwds):
self.Bind(wx.EVT_BUTTON, self.on_open_sync_dlg, self.sync_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_setup_dlg, self.setup_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_history_dlg, self.history_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_report_link, self.report_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_donate_link, self.donate_btn)
self.Bind(wx.EVT_BUTTON, self.on_start, self.start_ctrl)
self.Bind(wx.EVT_TEXT_ENTER, self.on_start, self.url_ctrl)
Expand All @@ -185,6 +197,10 @@ def on_open_history_dlg(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'on_open_history_dlg' not implemented!")
event.Skip()

def on_open_report_link(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'on_open_report_link' not implemented!")
event.Skip()

def on_open_donate_link(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'on_open_donate_link' not implemented!")
event.Skip()
Expand Down
20 changes: 18 additions & 2 deletions archoctopus/gui/msw_gui.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 1.0.4 on Wed Sep 14 22:52:12 2022
# generated by wxGlade 1.0.4 on Fri Sep 23 15:40:05 2022
#

import wx
Expand Down Expand Up @@ -58,29 +58,40 @@ def __init__(self, *args, **kwds):
sizer_28 = wx.BoxSizer(wx.VERTICAL)
sizer_25.Add(sizer_28, 0, wx.EXPAND, 0)

grid_sizer_1 = wx.GridSizer(1, 4, 0, 15)
grid_sizer_1 = wx.GridSizer(1, 5, 0, 15)
sizer_28.Add(grid_sizer_1, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 40)

self.sync_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(SYNC, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.sync_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.sync_btn.SetToolTip(u"同步")
self.sync_btn.SetBitmapCurrent(svg_bitmap(SYNC, 27, 27))
self.sync_btn.SetSize(self.sync_btn.GetBestSize())
grid_sizer_1.Add(self.sync_btn, 0, wx.ALIGN_CENTER, 0)

self.setup_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(SETTINGS, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.setup_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.setup_btn.SetToolTip(u"设置")
self.setup_btn.SetBitmapCurrent(svg_bitmap(SETTINGS, 27, 27))
self.setup_btn.SetSize(self.setup_btn.GetBestSize())
grid_sizer_1.Add(self.setup_btn, 0, wx.ALIGN_CENTER, 0)

self.history_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(HISTORY, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.history_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.history_btn.SetToolTip(u"历史")
self.history_btn.SetBitmapCurrent(svg_bitmap(HISTORY, 27, 27))
self.history_btn.SetSize(self.history_btn.GetBestSize())
grid_sizer_1.Add(self.history_btn, 0, wx.ALIGN_CENTER, 0)

self.report_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(REPORT, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.report_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.report_btn.SetToolTip(u"报告")
self.report_btn.SetBitmapCurrent(svg_bitmap(REPORT, 27, 27))
self.report_btn.SetSize(self.report_btn.GetBestSize())
grid_sizer_1.Add(self.report_btn, 0, wx.ALIGN_CENTER, 0)

self.donate_btn = wx.BitmapButton(self.panel_2, wx.ID_ANY, svg_bitmap(DONATE, 27, 27, colour=wx.WHITE), style=wx.BORDER_NONE | wx.BU_AUTODRAW | wx.BU_EXACTFIT | wx.BU_NOTEXT)
self.donate_btn.SetBackgroundColour(wx.Colour(0, 174, 239))
self.donate_btn.SetToolTip(u"赞助")
self.donate_btn.SetBitmapCurrent(svg_bitmap(DONATE, 27, 27))
self.donate_btn.SetSize(self.donate_btn.GetBestSize())
grid_sizer_1.Add(self.donate_btn, 0, wx.ALIGN_CENTER, 0)
Expand Down Expand Up @@ -167,6 +178,7 @@ def __init__(self, *args, **kwds):
self.Bind(wx.EVT_BUTTON, self.on_open_sync_dlg, self.sync_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_setup_dlg, self.setup_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_history_dlg, self.history_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_report_link, self.report_btn)
self.Bind(wx.EVT_BUTTON, self.on_open_donate_link, self.donate_btn)
self.Bind(wx.EVT_BUTTON, self.on_start, self.start_ctrl)
self.Bind(wx.EVT_TEXT_ENTER, self.on_start, self.url_ctrl)
Expand All @@ -185,6 +197,10 @@ def on_open_history_dlg(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'on_open_history_dlg' not implemented!")
event.Skip()

def on_open_report_link(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'on_open_report_link' not implemented!")
event.Skip()

def on_open_donate_link(self, event): # wxGlade: MyFrame.<event_handler>
print("Event handler 'on_open_donate_link' not implemented!")
event.Skip()
Expand Down
1 change: 1 addition & 0 deletions archoctopus/gui/resource/report.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion archoctopus/gui/resource/settings.svg

This file was deleted.

1 change: 1 addition & 0 deletions archoctopus/gui/resource/tools.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions archoctopus/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def __init__(self, *args, **kwds):

self.cfg = wx.GetApp().cfg # 全局配置对象
self.con = wx.GetApp().con # 数据库连接对象
self.netloc = wx.GetApp().netloc # 任务网络地址

self.is_auto_clip = True # 自动粘贴板
self.previous_url = "" # 用于判断系统粘贴板中的url是否已使用过
Expand Down Expand Up @@ -565,6 +566,12 @@ def on_start(self, event):
sql = "SELECT id FROM history WHERE url=?"
task_id = self.con.select_one(sql, (raw_url,))[0]

netloc = urlparse(raw_url).netloc
if netloc in self.netloc:
self.netloc[netloc] += 1
else:
self.netloc[netloc] = 1

# 判断重复下载时, 任务面板是否已创建
for _item in self.sizer_8.GetChildren():
_task_panel = _item.GetWindow()
Expand Down Expand Up @@ -616,6 +623,9 @@ def on_open_history_dlg(self, event):
history_dlg.ShowModal()
history_dlg.Destroy()

def on_open_report_link(self, event):
wx.LaunchDefaultBrowser(constants.REPORT_URL, flags=0)

def on_open_donate_link(self, event):
donate_dlg = AoDonateDlg(self)
donate_dlg.Show()
Expand Down Expand Up @@ -1654,6 +1664,8 @@ def OnInit(self):
self.con = AoDatabase(db=get_database_file())
# self.con = AoDatabase()

self.netloc = {}

mainFrame = AoMainFrame(None, wx.ID_ANY, constants.APP_DISPLAY_NAME)
self.SetTopWindow(mainFrame)
mainFrame.Show()
Expand Down
10 changes: 9 additions & 1 deletion archoctopus/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, parent, *args, **kwargs):

self.logger = logging.getLogger(APP_NAME)
self.con = parent.con
self.netloc = parent.netloc

def _num_history(self):
sql = "SELECT COUNT(id) FROM history"
Expand All @@ -56,6 +57,11 @@ def _sync_status(self):
status = [i[0] for i in result]
return status

def _top_history(self):
sql = "SELECT domain, count(*) num from history GROUP by domain ORDER by num DESC LIMIT 10"
result = self.con.select(sql)
return result

def _build_data(self):
platform_name, platform_version = _platform()
status = self._sync_status()
Expand All @@ -69,7 +75,8 @@ def _build_data(self):
"archdaily": "archdaily" in status,
"huaban": "huaban" in status,
"pinterest": "pinterest" in status
}
},
"netloc": self.netloc
}
return usage_data

Expand All @@ -82,5 +89,6 @@ def run(self) -> None:
r = httpx.post(USAGE_API_URL, headers=headers, json=data)
self.logger.debug("status: %s", r.status_code)
r.raise_for_status()
self.logger.debug(r.text)
except Exception as e:
self.logger.error(str(e))
6 changes: 3 additions & 3 deletions archoctopus/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
ArchOctopus Version.
"""

VERSION = "2.0.2"
VERSION_TUPLE = (2, 0, 2)
RELEASE_DATA = "2022-09-14"
VERSION = "2.0.3"
VERSION_TUPLE = (2, 0, 3)
RELEASE_DATA = "2022-09-25"
8 changes: 4 additions & 4 deletions release/build-msw/file_version_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(2, 0, 2, 0),
prodvers=(2, 0, 2, 0),
filevers=(2, 0, 3, 0),
prodvers=(2, 0, 3, 0),
# Contains a bitmask that specifies the valid bits 'flags'
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -31,12 +31,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u'Cortt Studio®'),
StringStruct(u'FileDescription', u'ArchOctopus -- 建筑师收集助手'),
StringStruct(u'FileVersion', u'2.0.2.0'),
StringStruct(u'FileVersion', u'2.0.3.0'),
StringStruct(u'InternalName', u'ArchOctopus'),
StringStruct(u'LegalCopyright', u'Copyright (C) 2021 CorttStudio®'),
StringStruct(u'OriginalFilename', u'ArchOctopus.exe'),
StringStruct(u'ProductName', u'ArchOctopus'),
StringStruct(u'ProductVersion', u'2.0.2.0')])
StringStruct(u'ProductVersion', u'2.0.3.0')])
]),
VarFileInfo([VarStruct(u'Translation', [2052, 936])])
]
Expand Down
3 changes: 0 additions & 3 deletions release/build-osx/dmg_build_cmd.txt

This file was deleted.

2 changes: 0 additions & 2 deletions release/build-osx/mac_build_cmd.txt

This file was deleted.

Loading

0 comments on commit 707012a

Please sign in to comment.