Software package quick downloading tool, medium and product of Kylin Launchpad
By developing Galaxy Kirin launchpad's software package quick download tool, the problem of low download efficiency caused by the diversity of software package versions in the Ubuntu Kylin project is solved, and multi-warehouse search and quick download are realized, which significantly improves the efficiency of R&D and operation.
Patent Information
- Application Number
- CN202411681419.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
In the Ubuntu Kylin project, there are more and more updates and iterative versions of software packages, which leads to R&D or technical service personnel need to manually find and download various versions of software packages, which takes too much time and reduces the efficiency of operation, maintenance and R&D debugging.
Develop a software package quick download tool for Galaxy Kirin launchpad to realize software package search in different warehouses and the quick download functions of source code packages and software packages. The tool includes a UI interface, a search module, a download module and a display module. By analyzing and extracting web page content, it realizes simple and efficient quick search and download of source code packages and deb packages.
It realizes the free switching of Galaxy Kirin launchpad multi-warehouses and one-click search function of software packages, simplifies the download process of source code packages and deb packages, significantly reduces download time, and improves the efficiency of operation, maintenance, R&D and debugging.
Smart Images

Figure CN119622127A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software technology, and specifically relates to a software package quick download tool, medium, and product of Kylin Launchpad. Background Art
[0002] Ubuntu Kylin is a global open source project led by Kylin Software Co., Ltd. and CCN Open Source Software Innovation Joint Laboratory. Galaxy Kylin launchpad is a key component of the Ubuntu Kylin project. During the development of the project, there are more and more updated and iterative versions of the software package. When making patches and distributing them to users, or when developing and debugging bugs, you need to find and download various versions of the software package. For example, the main repository for searching software packages includes kylin-desktop, kylin, kylin-gf, kylinos-desktop, etc., as well as various ppa created. Moreover, different repositories may contain different versions of software packages. A source package can also contain multiple deb packages, and deb packages also contain multiple platforms, such as arm, sw, loongarch, etc. R&D or technical service personnel need to manually jump to the web page one by one and download them one by one, which will take up too much time and greatly reduce the efficiency of operation maintenance and R&D debugging.
[0003] In order to improve the efficiency of searching and downloading source packages and software packages, it is necessary to develop a tool that integrates multiple repositories to realize the software package search in different repositories and the quick download function of source packages and software packages. Summary of the invention
[0004] The purpose of the present invention is to provide a tool, medium and product for quickly downloading software packages of Kylin Launchpad, so as to realize the software package search in different repositories of Kylin Launchpad and the quick download function of source code packages and software packages.
[0005] In order to achieve the above object, the technical solution of the present invention is as follows:
[0006] A quick download tool for software packages of Galaxy Kylin Launchpad, comprising:
[0007] UI interface: used to provide user operation interface;
[0008] Search module: splice the URL of the software package to be downloaded according to the user's selection and input operations on the UI interface. The URL of the software package to be downloaded is a uniform resource locator. Search according to the URL and use requests to obtain the searched web page content, and parse the software package and version in the web page content;
[0009] Download module: Based on the user's selection and input operations on the software package and version in the UI interface, the URL of the software package details page is spliced, and the web page content is obtained and parsed according to the URL of the software package details page to download and save the software package;
[0010] Display module: displays the information parsed by the search module and the download module on the UI interface for operation.
[0011] Furthermore, the download module also includes a shortcut operation, and the shortcut operation uses subprocess to call a file browser with one key to enter the save path of the downloaded software package.
[0012] Furthermore, the quick operation also includes using subprocess to call the terminal with one key to enter the save path of the downloaded software package.
[0013] Furthermore, the UI interface uses a tkinter library to implement information display, selection of a software package repository, selection of a software package and version, and input of keywords.
[0014] Furthermore, after using requests to obtain the searched web page content, the search module cooperates with lxml and xpath to parse the web page content, extracts the number of searched results and the list of software packages, and displays them in a list in the display module; according to the software package selected by the user in the list, the URL of the software package version list is spliced, and a search is performed and requests are used to obtain the content, and lxml and xpath are cooperated to parse and extract the number of searched results and the list of software package versions, and display them in a list in the display module.
[0015] Furthermore, in the download module, obtaining web page content and parsing according to the software package details page URL includes: obtaining the source code page of the selected software package version, and then using regular matching to obtain the link of the source code file; obtaining the deb address page of the selected software package version, and then using BeautifulSoup with platform to match the details link.
[0016] Furthermore, in the download module, obtaining web page content according to the software package details page URL and parsing it also includes: obtaining a change log page, and then using BeautifulSoup to match the change log text.
[0017] Furthermore, the URL sets the number of batches for loading the results when splicing.
[0018] The present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program loads the above-mentioned software package quick download tool of Kylin Launchpad.
[0019] The present invention also provides a computer program product, including a computer program, which loads the above-mentioned Kylin Launchpad software package quick download tool when executed by a processor.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] The present invention realizes the multi-warehouse free switching and one-key search function of the Galaxy Kylin launchpad. By parsing and extracting web page content, it realizes the concise and efficient quick search and download function of source code packages and deb packages. At the same time, the terminal or file browser can be called with one key to view the downloaded content. The present invention reduces the time loss of software package downloading and greatly improves the efficiency of operation maintenance and R&D debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a schematic diagram of the overall technical framework of an embodiment of the present invention;
[0023] Figure 2 It is an implementation flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0025] The present invention mainly includes UI display, software package search, software package list display, download link analysis, download and shortcut operation. The overall technical architecture is as follows: Figure 1 As shown, including:
[0026] (1) UI interface: The UI interface uses the simple and easy-to-use tkinter library, which mainly uses drop-down boxes, lists, buttons, text input boxes, etc.
[0027] (2) Search module: used for software package search, mainly uses requests to obtain the web page content of the spliced URL, and uses xpath to parse the software package and version.
[0028] (3) Display module: The searched software packages and versions are displayed in the UI interface in the form of a list.
[0029] (4) The download module splices the URL of the software package details page based on the obtained software package and version, obtains the HTML content, and then uses xpath / re / BeautifulSoup technology to parse the download link.
[0030] (5) After obtaining the download connection, the download module uses request and file.write to download and save the file.
[0031] (6) The download module also includes a quick operation part, which is implemented by calling the execution program using the subprocess library.
[0032] Based on the above technical framework, the specific implementation plan of this embodiment is as follows Figure 2 As shown, including:
[0033] 1. First, select the warehouse. Set the drop-down box for warehouse selection in the UI interface, and select kylin-desktop, kylin-gf, kylin or kylinos-desktop from the drop-down box, and record it as branch_name.
[0034] 2. Enter the keyword of the software package to be searched, record it as search_key, set the "Fuzzy Search" button in the UI interface, and execute the function search_name to obtain the software package list. In the function, first press url = base_url + " / " + branch_name + " / + search? text = "+ search_key + "& batch = 100& start = "+
[0035] The rule of str(search_name_start) spells out the url to be accessed for searching software packages. Among them, base_url is "https: / / dev.kylinos.cn", the initial value of search_name_start is 0, and the page turning function is realized by modifying this value later. batch=100 means loading 100 results. If there are less than 100 results, the actual number of results will be loaded. Then use requests.get(url,verify=False,headers=headers).content to obtain the web page content, and then use lxml and xpath to parse the web page content, extract the searched number and software package list, and display them on the UI interface through the display module. The list control is recorded as search_name_dropdown_listbox. If the number of results is greater than 100, set the next page button to click, add 100 to search_name_start, and then call the search_name function. Similarly, set the previous page button to click, subtract 100 from search_name_start, and then call the search_name function.
[0036] 3. Select a package name in the search_name_dropdown_listbox and set the selected package name to be displayed in deb_name_entry. You can also enter the exact package name into deb_name_entry and record the package name as deb_name.
[0037] 4. Click the "Search" button to execute the search function to obtain the software package version list. First, write out the webpage address according to the rule of publishinghistory=base_url+" / "+branch_name+" / +source / "+deb_name+" / +publishinghistory?batch=100&start="+str(search_versions_start), where the initial value of search_versions_start is 0. The page turning function is realized by modifying this value later. batch=100 means loading 100 results. If there are less than 100 results, the actual number of results will be loaded. Then use requests.get(publishinghistory, verify=False, headers=headers).content to get the webpage content, and then parse the webpage content with lxml and xpath, extract the searched number and package version list, and display them on the UI interface through the display module. The list control is recorded as versions_dropdown_listbox, and the package version and the corresponding href tag content are saved in version_dict. The href format is such as " / kylin-gf / +source / peony / 3.20.4.14-0k3.11gf3.66". If the number of results is greater than 100, set the next page button to click, add 100 to search_versions_start, and then call the search function. Similarly, set the previous page button to click, subtract 100 from search_versions_start, and then call the search function.
[0038] 5. Select a version in the package version list, record it as selected_value, and then spell out the URL according to the rule of url=base_url+version_dict[selected_value], similar to "https: / / dev.kylinos.cn / kylin-gf / +source / peony / 3.20.4.14-0k3.11gf3.66". Then set the URL to input_details_url for display. You can also enter the accurate package details address yourself, record it as details_url.
[0039] 6. Set the "View changelog" button on the UI interface. After clicking it, execute the get_changelog function to view the change log. In the function, use requests to get the content of details_url, and then use BeautifulSoup to match the changelog text.
[0040] 7. Set the "Get Source Code" button on the UI interface, and click it to execute the get_code_links function. In the function, use requests to get the details_url content, and then use the re regular expression to match links containing .tar.xz, .dsc, .tar.gz, .debian.tar.xz, orig.tar.gz, and tar.gz.asc. Put the matched links into code_links, concatenate the links, and call the copy_to_clipboard function to copy them to the clipboard.
[0041] 8. Set the "Download Source File" button on the UI interface. Click it to execute the download_files function and pass code_links as a parameter. In the function, use requests with file.write to download and save files. The saved path defaults to the deb_download path in the user's home directory, which can be changed freely. The path is recorded as save_path.
[0042] 9. Set the drop-down box for selecting the architecture on the UI interface. After clicking the drop-down box for selecting the architecture, select one of "arm64", "amd64", "loongarch64", "mips64el", "sw64", and record it as platform.
[0043] 10. Set the "Get deb address" button on the UI interface, click it and execute the get_deb_links function. In the function, use requests to get the content of details_url, and then use BeautifulSoup with platform to match the details link of the architecture, such as " / kylin-gf / +source / peony / 3.20.4.14-0k3.11gf3.66 / +build / 1473010", and combine it with base_url to become "https: / / dev.kylinos.cn / kylin-gf / +source / peony / 3.20.4.14-0k3.11gf3.66" / +build / 1473010", which is the package details link under the current architecture, and then use requests to obtain the content of the details page, and use BeautifulSoup to match all links containing the words platform+.d, which is the final download link of this version of the package under this architecture, such as "http: / / dev.kylinos.cn / +librarian / 12151195 / libpeony-dev_3.20.4.14-0k3.11gf3.66_amd64.deb", etc., and then save it to deb_links, splice the links, and call the copy_to_clipboard function to copy it to the clipboard.
[0044] 11. Set the "Download deb file" button on the UI interface. Click it to execute the download_files function and pass deb_links as a parameter. In the function, use requests with file.write to download and save files.
[0045] 12. Set the "Open Download Path" button on the UI interface. Click it to execute the open_save_path function. In the function, use subprocess.run(["xdg-open",save_path]) to open the file browser and enter the download path.
[0046] 13. Set the "Terminal entry path" button on the UI interface, and execute the open_terminal function after clicking it. In the function, use subprocess.Popen(["mate-terminal", "--working-directory", save_path]) to call the terminal to enter the download path.
[0047] This embodiment proposes a one-click search and download tool for Kylin Launchpad software packages, which integrates multiple software package repositories and multiple architectures, combines Python and HTML, uses requests, lxml, BeautifulSoup, and re, and realizes fast search of software package lists and extraction of software package source code download addresses by reading and parsing HTML content. At the same time, it realizes the one-click download function and the one-click entry into the download directory function.
[0048] The features of this embodiment are as follows:
[0049] (1) By changing the URL, you can switch between multiple repositories such as kylin-desktop, kylin, kylin-gf, kylinos-desktop, etc. with one click.
[0050] (2) Software package search function: quickly search for software packages in multiple repositories and view the changelog of the version with one click.
[0051] (3) Use requests, lxml, BeautifulSoup, re and other methods to load the content of different web pages and match and extract the download addresses of source code packages and deb packages.
[0052] (4) Integrate multiple download links to realize batch one-click download function.
[0053] (5) Use subprocess to call the file browser and terminal to enter the download path with one click.
[0054] The above-mentioned embodiments are only preferred implementations of the present invention, and are only used to help understand the method and core ideas of the present application. The protection scope of the present invention is not limited to the above-mentioned embodiments. All technical solutions under the idea of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A software package quick download tool for Kylin Launchpad, characterized in that: include: UI interface: used to provide user operation interface; Search module: splice the URL of the software package to be downloaded according to the user's selection and input operations on the UI interface. The URL of the software package to be downloaded is a uniform resource locator. Search according to the URL and use requests to obtain the searched web page content, and parse the software package and version in the web page content; Download module: Based on the user's selection and input operations on the software package and version in the UI interface, the URL of the software package details page is spliced, and the web page content is obtained and parsed according to the URL of the software package details page to download and save the software package; Display module: displays the information parsed by the search module and the download module on the UI interface for operation.
2. The software package quick download tool of Kylin Launchpad according to claim 1, characterized in that: The download module also includes a shortcut operation, which uses a subprocess to call a file browser with one key to enter the save path of the downloaded software package.
3. The software package quick download tool of Kylin Launchpad according to claim 2, characterized in that: The quick operation also includes using subprocess to call the terminal with one key to enter the saving path of the downloaded software package.
4. The software package quick download tool of Kylin Launchpad according to claim 1, characterized in that: The UI interface uses the tkinter library to realize information display, selection of software package warehouse, selection of software package and version, and input of keywords.
5. The software package quick download tool of Kylin Launchpad according to claim 1, characterized in that: After using requests to obtain the searched web page content, the search module cooperates with lxml and xpath to parse the web page content, extracts the number of searched results and the software package list, and displays them in a list on the display module; according to the software package selected by the user in the list, the URL of the software package version list is spliced, and the search is performed and the content is obtained using requests, and the number of searched results and the software package version list are parsed and extracted in cooperation with lxml and xpath, and displayed in a list on the display module.
6. The software package quick download tool of Kylin Launchpad according to claim 1, characterized in that: In the download module, obtaining web page content according to the software package details page URL and parsing includes: obtaining the source code page of the selected software package version, and then using regular matching to obtain the link of the source code file; obtaining the deb address page of the selected software package version, and then using BeautifulSoup with platform to match the details link.
7. The software package quick download tool of Kylin Launchpad according to claim 6, characterized in that: In the download module, obtaining web page content according to the software package details page URL and parsing it also includes: obtaining a change log page, and then using BeautifulSoup to match the change log text.
8. The software package quick download tool of Kylin Launchpad according to claim 1, characterized in that: The url sets the number of batches to load the results when splicing.
9. A computer-readable storage medium storing a computer program, characterized in that: The computer program loads the software package quick download tool of the Kylin Launchpad as described in any one of claims 1-8.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by the processor, it loads the software package quick download tool of the Kylin Launchpad as described in any one of claims 1-8.