活动介绍
file-type

轻松同步收藏夹:Universal favorites浏览器扩展

下载需积分: 5 | 259KB | 更新于2025-05-20 | 105 浏览量 | 0 下载量 举报 收藏
download 立即下载
标题和描述中提到的知识点可以详细解读如下: 1. 浏览器扩展的基本概念:浏览器扩展是一种由第三方开发者编写的程序,它可以增强或改变浏览器的基本功能。扩展通常安装在浏览器的扩展管理界面中,可以为用户提供各种便捷的服务和工具。本例中的扩展名为“Universal_favorites”,即通用收藏夹。 2. 收藏夹系统的功能:收藏夹,亦称书签,是浏览器中用来保存用户经常访问网页地址的工具。用户通过收藏夹可以快速访问这些网页,而无需再次搜索或输入网址。通用收藏夹扩展提供了一个类似的功能,使用户在使用不同浏览器时依然可以访问和管理自己的收藏夹。 3. 跨浏览器的兼容性与独立性:该扩展特别强调与任何特定浏览器实现无关,意味着它不依赖于单一浏览器平台的特定功能。因此,它可以在多种支持扩展的浏览器中使用,如Firefox、Chrome以及所有基于Chromium的浏览器(如Opera、Edge等)。 4. 跨浏览器同步收藏夹的功能:通过使用Google Drive作为中间存储,该扩展实现了在不同浏览器之间的收藏夹同步。Google Drive是一个云存储服务,能够使用户在线存储文件,并在多个设备之间共享和同步文件。 5. 与其他书签系统的对比:通用收藏夹扩展与其他书签系统(如Pocket或Instapaper)相比,具有独立的文件夹结构,允许用户创建和管理文件夹,这为用户提供了更符合常规浏览器书签使用习惯的体验。同时,它提供了更广泛的扩展性,不仅仅局限于保存文章链接。 6. 移动浏览器的支持:除了桌面浏览器,通用收藏夹扩展也支持那些接受扩展程序的移动浏览器,如Firefox和Kiwi浏览器。这意味着移动用户也可以享受到与桌面用户相似的收藏夹同步体验。 根据标签“chrome-extension firefox sync bookmark drag google-drive favorites FirefoxJavaScript”进一步理解相关知识点: 1. 浏览器扩展的开发语言:FirefoxJavaScript,即Firefox用的JavaScript,是用于开发Firefox浏览器扩展的主要编程语言。JavaScript广泛应用于网页和浏览器扩展开发中,以实现动态的内容交互和功能。 2. 扩展与浏览器的兼容性:chrome-extension,表明此扩展支持Chrome浏览器。一个成功的浏览器扩展通常需要根据各浏览器提供的API(应用程序编程接口)进行定制开发,以实现功能的兼容性。 3. 收藏夹(书签)管理功能:bookmark,强调通用收藏夹扩展在书签管理方面的功能。 4. 同步功能:sync,突出了此扩展的主要特点之一,即能够实现不同浏览器或设备之间的收藏夹同步。 5. 文件夹操作:drag,可能意味着此扩展支持通过拖放等操作来管理收藏夹文件夹,从而提升用户的使用体验。 最后,“universal_favorites-master”是该压缩包子文件的名称,它可能是一个压缩包文件,通常用于软件开发者发布或管理他们的项目代码。在本例中,这个文件可能是通用收藏夹扩展的源代码或其他相关资源的集合,用于进一步的开发或部署。

相关推荐

filetype

<template> <view class="page-container"> <view class="search-container"> <view class="search-box" @click="gotosearch"> <image src="/static/搜索.png" class="search-icon"></image> <input class="search-input" placeholder="请输入关键词" placeholder-class="placeholder-style" confirm-type="search" /> </view> </view> <view class="tab-container"> <view v-for="(tab, index) in tabs" :key="index" class="tab-item" :class="{ active: currentTab === index }" @click="selectTab(index)" > {{ tab }} </view> </view> <view class="product-list"> <view v-for="(product, index) in currentProducts" :key="index" class="product-item" @click="goToDetail(product.product_id)" > <text class="product-title">{{ product.product_name }}</text> <image :src="`/static/${product.img}`" class="product-image"></image> <view class="product-stats"> <view class="stat-item"> <image src="/static/eye.png" class="stat-icon"></image> <text>{{ product.views || 0 }}</text> </view> <view class="stat-item"> <image src="/static/start.png" class="stat-icon"></image> <text>{{ product.favorites || 0 }}</text> </view> </view> </view> </view> </view> </template> <script> export default { data() { return { // 标签数据 tabs: ["精选", "送女生", "送男生"], // 当前选中的标签索引 currentTab: 0, // 商品数据 products: { 精选: [ { product_id: 1008, product_name: "双胞胎辣条", img: "双胞胎辣条.png", price: 3 ,product_title:"便宜!实惠!就选双胞胎辣条",product_content:"双胞胎辣条,这个让人欲罢不能的网红零食是怎么来的?其实背后有着一段有趣的故事。创始人受童年回忆启发,结合现代口味,经过无数次尝试,最终创造了这款美味的辣条。它不仅口感独特,还有多种口味供选择,满足不同人群的需求。双胞胎辣条这个名字听起来是不是有点奇怪?为什么叫“双胞胎”呢?其实,这背后有着一段有趣的故事。创始人张总小时候,他家附近有一家小零食铺,他特别喜欢那里的辣条。长大后,张总决定创业,想要创造一款像儿时记忆中那样美味的辣条。经过无数次的尝试和调整,张总终于找到了灵感。他决定制作一款口感独特、健康美味的辣条,让每一个吃过的人都能回味无穷。"}, { product_id: 1007, product_name: "清洁刷", img: "清洁刷.png", price: 15 }, { product_id: 1009, product_name: "电子烤架", img: "电子烤架.png", price: 150 } ], "送女生": [ { product_id: 1010, product_name: "加湿器", img: "加湿器.png", price: 140 }, { product_id: 1011, product_name: "镜子", img: "镜子.png", price: 12 }, { product_id: 1012, product_name: "烤酸奶", img: "烤酸奶.png", price: 48 ,product_title:"古老的制作手艺!传统甜食——烤酸奶",product_content:"烤酸奶是源自俄罗斯的一种传统的酸奶制作工艺,也称为俄罗斯烤酸奶。在十六世纪中期,俄罗斯北高加索地区的牧羊人发现,随身携带羊皮囊中的牛奶由于受到篝火炙烤,经过发酵后,色泽金黄,带有微醺的酪香,成为当地流行的特色酸奶,清朝末年,这种酸奶被俄罗斯商人带到哈尔滨,作为茶歇上品在上流社会广泛流传,被称之为“俄罗斯烤酸奶”"}, { product_id: 1013, product_name: "猫窝", img: "猫窝.png", price: 75 }, { product_id: 1014, product_name: "巧克力", img: "巧克力.png", price: 25 }, { product_id: 1015, product_name: "袜子", img: "袜子.png", price: 10 }, { product_id: 1016, product_name: "燕麦", img: "燕麦.png", price: 73 }, { product_id: 1017, product_name: "小风扇", img: "小风扇.png", price: 45 }, { product_id: 1018, product_name: "雪糕", img: "雪糕.png", price: 10 }, { product_id: 1019, product_name: "面包", img: "面包.png", price: 20 }, { product_id: 1020, product_name: "饼干", img: "饼干.png", price: 15 } ], "送男生": [ { product_id: 1001, product_name: "插座", img: "插座.png", price: 20 }, { product_id: 1002, product_name: "电脑椅", img: "电脑椅.png", price: 105 }, { product_id: 1003, product_name: "置物架", img: "置物架.png", price: 14 }, { product_id: 1004, product_name: "空调扇", img: "空调扇.png", price: 500 }, { product_id: 1005, product_name: "oppo手机", img: "oppo手机.png", price: 2000 }, { product_id: 1006, product_name: "oppoa5", img: "oppoa5.png", price: 1000 } ] }, // 当前显示的商品列表 currentProducts: [] }; }, created() { // 初始化时加载“精选”商品列表 this.currentProducts = this.products.精选; }, methods: { // 跳转到搜索页面 gotosearch() { uni.navigateTo({ url: "/pages/search" }); }, // 切换标签 selectTab(index) { this.currentTab = index; const tabName = this.tabs[index]; this.currentProducts = this.products[tabName]; }, // 跳转到商品详情页 goToDetail(productId) { uni.navigateTo({ url: `/pages/Strategy/Product-Details?id=${productId}` }); } } }; </script> <style lang="scss"> /* 页面容器 */ .page-container { padding-top: 120rpx; background-color: #f5f5f5; } /* 搜索框样式 */ .search-container { position: fixed; top: 0; left: 0; width: 100%; padding: 15rpx 30rpx; background: #ffffff; z-index: 999; box-sizing: border-box; } .search-box { display: flex; align-items: center; height: 70rpx; background: #f5f5f5; border-radius: 20rpx; padding: 0 20rpx; } .search-icon { width: 32rpx; height: 32rpx; margin-right: 15rpx; } .search-input { flex: 1; font-size: 28rpx; } /* 标签导航 */ .tab-container { display: flex; justify-content: space-around; padding: 20rpx 0; margin-top: -80rpx; background-color: #ffffff; } .tab-item { font-size: 30rpx; color: #333; &.active { color: #1aad19; font-weight: bold; } } /* 商品列表 */ .product-list { display: flex; flex-direction: column; padding: 20rpx; } .product-item { margin-bottom: 20rpx; background-color: #ffffff; border-radius: 10rpx; overflow: hidden; box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); } .product-title { font-size: 26rpx; padding: 10rpx; margin-left: 42%; } .product-image { width: 100%; height: 330rpx; } .product-stats { display: flex; justify-content: space-between; padding: 10rpx; } .stat-item { display: flex; align-items: center; } .stat-icon { width: 30rpx; height: 30rpx; margin-right: 10rpx; } </style> 根据上述代码完善以下要求 每点击一次商品列表图片跳转到商品详情页后,eye图标旁边的数字加一,点击start图标后其旁边数字也加一,但只能点一次

filetype

12-31 09:46:16.114015 3691 4769 D AlbumDataOperationProcessor: handlerMessage:doBatch 1767145575604->1767145575604,cost=509,count=55+0,UPDATE_LOCAL->3, 12-31 09:46:16.114176 3691 4769 D AlbumCacheOperationTask: run: start sync 1767145576114 12-31 09:46:16.123526 3691 4769 D AlbumCacheOperationTask: queryExistedAlbumByBatch:end A(-134776996,AllPicture,/.AllPicture,f=2,292:0,p=0:-1,1,[-134776996]) ,A(2064266562,Camera,/DCIM/Camera,f=1,265:0,p=1:-1,1,[-1739773001, -508660256]) ,A(1552915770,AllVideos,/.AllVideos,f=2,10:0,p=2:-1,1,[1552915770]) ,A(44883741,Map,/.Map,f=2,0:0,p=4:-1,1,[44883741]) ,A(1209727497,AllOliveSet,/.AllOliveSet,f=34,10:0,p=6:-1,1,[1209727497]) ,A(1058788833,PortraitBlur,/.PortraitBlur,f=34,24:0,p=7:-1,1,[1058788833]) ,A(-641215801,AllCShotSet,/.AllCShotSet,f=34,22:0,p=8:-1,1,[-641215801]) ,A(1314986163,RecycleBin,/.RecycleBin,f=258,0:0,p=9:-1,1,[1314986163]) , 12-31 09:46:16.123847 3691 4769 D AlbumCacheOperationTask: queryExistedAlbums:end cost=2,ACount=1,BCount=17 12-31 09:46:16.124032 3691 4769 D AlbumSetSyncUtil: sortAlbumsByCover: album not need sort, size=0 12-31 09:46:16.124075 3691 4769 D AlbumCacheDataUpdater: updateToTableAfterOrder: allSize=8->8,newSize=0,bottomSize=0,vSize=7,root=[null,null}] 12-31 09:46:16.124142 3691 4769 D AlbumCacheDataUpdater: setupTableAlbumsAndBuckets:end A(2064266562,Camera,/DCIM/Camera,f=1,265:0,p=1:-1,1,[-1739773001, -508660256]) ,A(-134776996,AllPicture,/.AllPicture,f=2,292:0,p=0:-1,1,[-134776996]) ,A(1552915770,AllVideos,/.AllVideos,f=2,10:0,p=2:-1,1,[1552915770]) ,A(44883741,Map,/.Map,f=2,0:0,p=4:-1,1,[44883741]) ,A(1209727497,AllOliveSet,/.AllOliveSet,f=34,10:0,p=6:-1,1,[1209727497]) ,A(1058788833,PortraitBlur,/.PortraitBlur,f=34,24:0,p=7:-1,1,[1058788833]) ,A(-641215801,AllCShotSet,/.AllCShotSet,f=34,22:0,p=8:-1,1,[-641215801]) ,A(1314986163,RecycleBin,/.RecycleBin,f=258,0:0,p=9:-1,1,[1314986163]) , 12-31 09:46:16.125861 3691 4769 D g_db.CacheProvider: notifyUri, no need notify return 12-31 09:46:16.125888 3691 4769 D g_db.CacheProvider: notifyUri, no need notify return 12-31 09:46:16.127761 1492 3356 D gaia-GaiaSendManager: send: 269496324, eventTag = stop_catch_log 12-31 09:46:16.127981 3691 4769 D UriNotifier: notifyTableChange:table:albumTable,params:null content://com.oplus.gallery.database.provider.cache/albumTable 12-31 09:46:16.128028 1492 3356 D gaia-GaiaPacketWriter: putPacket , packetId = 1053 12-31 09:46:16.128604 1492 1742 D gaia-GaiaPacketWriter: sendPacket success, data = com.oplus.olc.gaia.Packet@b1af0db 12-31 09:46:16.128840 1523 1664 W LOG_FLOWCTRL: ==LOGS OVER PROC QUOTA(300), rows(320) bytes(27452) oplus_gaia u(0) l(0) t(0) c(0) DROPPED== 12-31 09:46:16.128840 1523 1664 D gaia:event_server: [handleEvent:34]parse event from rawMsg: {"data":"{\"isUserMode\":false}","eventId":269496324,"packetId":"1053","type":0} 12-31 09:46:16.128891 3691 4769 D UriNotifier: notifyTableChange:table:albumCountTab,params:null content://com.oplus.gallery.database.provider.cache/albumCountTab 12-31 09:46:16.129016 1523 1664 D gaia:event_source: [publishEvent:38]EventSource PublishpipelineEvent 0x10103004 12-31 09:46:16.129156 1523 20593 D gaia:thread_pool: [operator():62]threadPool(CommonEventSource) worker do one work 12-31 09:46:16.129281 1523 20593 D gaia:LogWorkManager: [canProcessEvent:97]plugin(LogWorkManager) canProcessEvent call, eventId: 0x10103004, getDataIn:{"isUserMode":false} 12-31 09:46:16.129286 3691 4769 D AlbumCacheDataUpdater: updateToTable: Count[total=4 iA=0,uA=2,dA=0,iB=0,uB=2,dB=0] 12-31 09:46:16.129337 1523 20593 D gaia:plugin: [processEvent:37]plugin(LogWorkManager) schedule event on it's event looper 12-31 09:46:16.129540 1523 1662 D gaia:LogWorkManager: [onEvent:82]plugin(LogWorkManager) onEvent call, eventId: 0x10103004, getDataIn:{"isUserMode":false} 12-31 09:46:16.129631 1523 1662 D gaia:LogWorkManager: [stopCatchLog:589]plugin(LogWorkManager) stopLog call, data_:{"isUserMode":false} 12-31 09:46:16.129677 3691 4769 D AlbumCacheOperationTask: run: end sync 1767145576114 cost=15 listenerCost=0 12-31 09:46:16.130405 3691 4769 D AlbumCacheTaskDispatcher: runIfNeed: no task! from=next 12-31 09:46:16.131238 1492 11098 D LogKit_DumpUtil: service = activity, cmd = [service, MIDASService, --copydb] 12-31 09:46:16.131243 15196 15412 V OplusTrack-OplusTrack: onCommon logTag is 200,eventID:shutter_button_click,flagSendTo:1 12-31 09:46:16.131464 15196 15412 D OCAM_DcsDataCollectorImpl: setLastShutterDownPreviewTimestamp, previewTimestamp: 0 12-31 09:46:16.131540 15196 16860 D OplusTrack-ContentProviderRecorder: content://com.oplus.statistics.provider/track_event use ContentProviderClient from cache 12-31 09:46:16.132838 6120 11326 D PickerSyncLockManager: Trying to acquire lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] with timeout. 12-31 09:46:16.132884 6120 11326 D CloseableReentrantLock: Successfully acquired lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Locked by thread pool-3-thread-1]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.132917 6120 11326 D PickerSyncController: Saving next page token: 1767145550726|692 for key: local_provider:media_add:resume 12-31 09:46:16.134084 6120 11326 D CloseableReentrantLock: Successfully released lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.135315 6120 11326 D PickerNotificationSender: Sending a notification for media update 12-31 09:46:16.135858 1176 1194 W android.hardware.thermal-service.mediatek: parseMsg: Get from client TYPE=thermal_hal_notify NAME=SKIN 12-31 09:46:16.135964 1176 1194 W android.hardware.thermal-service.mediatek: parseMsg:name.c_str():SKIN 12-31 09:46:16.135980 1176 1194 W android.hardware.thermal-service.mediatek: parseMsg:tz notify:SKIN 12-31 09:46:16.136134 1176 1194 I android.hardware.thermal-service.mediatek: Wait to accept a connection 12-31 09:46:16.136305 6120 11326 D PickerNotificationSender: Sending a notification for merged album media update Favorites 12-31 09:46:16.136322 6120 11326 D PickerNotificationSender: Sending a notification for album media update Favorites 12-31 09:46:16.136726 1176 1194 I android.hardware.thermal-service.mediatek: Sending notification: Type: SKIN Name: SKIN CurrentValue: 41.659 ThrottlingStatus: SEVERE 12-31 09:46:16.136953 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.137163 1176 1194 I android.hardware.thermal-service.mediatek: sendThermalChangedCallback 12-31 09:46:16.137448 6120 11326 D PickerNotificationSender: Sending a notification for merged album media update Videos 12-31 09:46:16.137465 6120 11326 D PickerNotificationSender: Sending a notification for album media update Videos 12-31 09:46:16.138277 1925 4465 E ThermalManagerService: No threshold found for shell_skin 12-31 09:46:16.138499 1925 4465 E ThermalManagerService: No threshold found for shell_skin 12-31 09:46:16.138616 6120 11326 D ExternalDbFacade: Token received for queryMedia = 1767145550726|692 12-31 09:46:16.142216 6120 11326 D PickerSyncLockManager: Trying to acquire lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] with timeout. 12-31 09:46:16.142264 6120 11326 D CloseableReentrantLock: Successfully acquired lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Locked by thread pool-3-thread-1]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.142296 6120 11326 D PickerSyncController: Clearing next page token for key: local_provider:media_add:resume 12-31 09:46:16.142348 6120 11326 D CloseableReentrantLock: Successfully released lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.142360 6120 11326 D PickerNotificationSender: Sending a notification for media update 12-31 09:46:16.143971 6120 11326 D PickerNotificationSender: Sending a notification for merged album media update Favorites 12-31 09:46:16.143991 6120 11326 D PickerNotificationSender: Sending a notification for album media update Favorites 12-31 09:46:16.146300 1492 11100 D LogKit_LogWatcherManager: setLogObserverProp end 12-31 09:46:16.149600 15196 15412 D OCAM_ComprehensivePerformance: addClickShutterTime, clickShutterTime: 1767145529527 12-31 09:46:16.149836 15196 15412 V OplusTrack-OplusTrack: onCommon logTag is 200,eventID:shutter_button_click,flagSendTo:1 12-31 09:46:16.149984 15196 16860 D OplusTrack-ContentProviderRecorder: content://com.oplus.statistics.provider/track_event use ContentProviderClient from cache 12-31 09:46:16.150147 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.150168 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.149904 6120 11326 D PickerNotificationSender: Sending a notification for merged album media update Videos 12-31 09:46:16.150254 6120 11326 D PickerNotificationSender: Sending a notification for album media update Videos 12-31 09:46:16.151505 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData 12-31 09:46:16.151741 6120 11326 I PickerSyncController: Paged sync successful. QueryArgs: Bundle[{android.provider.extra.PAGE_TOKEN=1767145550726|692, android.provider.extra.SYNC_GENERATION=5922, android.provider.extra.PAGE_SIZE=1000}] Total Rows: 2 12-31 09:46:16.151956 6120 11326 I PickerSyncController: Executing SyncRemove. isLocal: true. authority: com.android.providers.media.photopicker 12-31 09:46:16.152011 6120 11326 D PickerSyncLockManager: Trying to acquire lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] with timeout. 12-31 09:46:16.152030 6120 11326 D CloseableReentrantLock: Successfully acquired lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Locked by thread pool-3-thread-1]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.152048 6120 11326 D CloseableReentrantLock: Successfully released lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.153804 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.154247 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.154630 6120 11326 D PickerSyncLockManager: Trying to acquire lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] with timeout. 12-31 09:46:16.154673 6120 11326 D CloseableReentrantLock: Successfully acquired lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Locked by thread pool-3-thread-1]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.154688 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.154702 6120 11326 D PickerSyncController: Clearing next page token for key: local_provider:media_remove:resume 12-31 09:46:16.154724 15196 15412 V OCAM_LocationManager: getCurrentLocation, No location received yet. 12-31 09:46:16.154737 15196 15412 V OCAM_GeoManager: current location is null, so use last location 12-31 09:46:16.154747 15196 15412 I OCAM_GeoManager: getCurrentLocation, mlastKnowLocation is already out of date, use last location from system. 12-31 09:46:16.155470 15196 15412 D LocationManagerExtImpl: getLastLocation provider: gps, uid: 10185, com.oplus.camera 12-31 09:46:16.155563 15196 15412 D LocationManagerExtImpl: getLocationByProvider: gps Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.155573 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.156073 15196 15412 D LocationManagerExtImpl: getLastLocation provider: network, uid: 10185, com.oplus.camera 12-31 09:46:16.156129 15196 15412 D LocationManagerExtImpl: getLocationByProvider: network Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.156138 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.156747 1925 5353 I AppFeature_provider: com.oplus.camera query feature:com.oplus.camera.privacy_compliance from app_feature table. 12-31 09:46:16.154751 6120 11326 D CloseableReentrantLock: Successfully released lock com.android.providers.media.photopicker.sync.CloseableReentrantLock@5e72242[Unlocked]. Lock Name = CLOUD_PROVIDER_LOCK. Threads that may be waiting to acquire this lock = [] 12-31 09:46:16.157636 6120 11326 D PickerNotificationSender: Sending a notification for media update 12-31 09:46:16.158831 6120 11326 D PickerNotificationSender: Sending a notification for merged album media update Favorites 12-31 09:46:16.158851 6120 11326 D PickerNotificationSender: Sending a notification for album media update Favorites 12-31 09:46:16.160556 6120 11326 D PickerNotificationSender: Sending a notification for merged album media update Videos 12-31 09:46:16.160575 6120 11326 D PickerNotificationSender: Sending a notification for album media update Videos 12-31 09:46:16.160833 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData X 12-31 09:46:16.161305 6120 11326 I PickerSyncController: Paged sync successful. QueryArgs: Bundle[{android.provider.extra.PAGE_TOKEN=1767145550726|692, android.provider.extra.SYNC_GENERATION=5922, android.provider.extra.PAGE_SIZE=1000}] Total Rows: 0 12-31 09:46:16.161385 1925 4465 D ActivityManager: freezer override set to true 12-31 09:46:16.162032 1925 4465 D ActivityManager: freezer override callers: 1925/1000 com.android.server.am.ActiveServices.dumpService:8857 com.android.server.am.ActivityManagerService.doDump:11987 com.android.server.am.ActivityManagerService.-$$Nest$mdoDump:0 com.android.server.am.ActivityManagerService$1.dump:882 com.android.server.utils.PriorityDump.dump:182 12-31 09:46:16.162827 15196 15412 V OCAM_a_BaseMode: getPictureSize, sizeList: [4096x3072, 4096x2304, 4096x2048, 4096x1872, 4096x1844, 4096x1712, 3840x2176, 3840x2160, 3264x2448, 3072x3072, 2800x1280, 2780x1264, 2560x1920, 2560x1440, 2520x1080, 2412x1080, 2400x1080, 2400x1072, 2400x1028, 2392x1080, 2340x1080, 2304x1728, 2280x1080, 2160x1080, 2134x960, 2100x1200, 2048x1536, 1920x1440, 1920x1088, 1920x1080, 1728x720, 1600x728, 1600x720, 1560x720, 1520x720, 1440x1080, 1440x720, 1296x540, 1280x960, 1280x720, 1152x720, 1088x1088, 1080x720, 960x960, 960x720, 800x400, 720x720, 720x480, 640x480, 352x288, 320x240, 176x144, 4032x3024, 960x1080, 640x720, 640x368, 464x464, 432x240, 320x320] 12-31 09:46:16.162864 15196 15412 V OCAM_SizeUtils: getOptimalSizeByRatio, size: 4096x1844, targetRatio: 2.2222222222222223 precise true 12-31 09:46:16.163208 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.163239 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.163405 6120 11326 I PickerSyncTracker: Marked sync future complete for work id: 21f11473-b4bb-4fba-8c80-7db758f8a202. Future map: {} 12-31 09:46:16.163443 6120 11326 I PSyncWorker: Completed picker proactive sync complete from local provider. 12-31 09:46:16.163446 1925 4465 D ActivityManager: freezer override set to false 12-31 09:46:16.163535 15196 15412 I OCAM_CameraCore: startCollectDcsCaptureData, builder hash: 41162595 12-31 09:46:16.163589 15196 15412 D OCAM_DcsReporter207: reportFunctionalErrorData, key: capture_failed, value: 17 12-31 09:46:16.163801 1925 4465 D ActivityManager: freezer override callers: 1925/1000 com.android.server.am.ActiveServices.dumpService:8900 com.android.server.am.ActivityManagerService.doDump:11987 com.android.server.am.ActivityManagerService.-$$Nest$mdoDump:0 com.android.server.am.ActivityManagerService$1.dump:882 com.android.server.utils.PriorityDump.dump:182 12-31 09:46:16.164084 15196 15412 V OplusTrack-OplusTrack: onCommon logTag is 207,eventID:functional_error,flagSendTo:1 12-31 09:46:16.164475 15196 15412 D OCAM_ComprehensivePerformance: removeClickShutterTime, capture Failed clickShutterTime: 1767145529527 12-31 09:46:16.164516 15196 15412 D OCAM_Performance: onOsenseEventSceneChanged, pressure MEM eventStateType: 2, startTime: 1767145529282, currentAvailmem: 577, killTriggerMem: 1800, memLevel: 1 12-31 09:46:16.164514 6120 6509 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=21f11473-b4bb-4fba-8c80-7db758f8a202, tags={ com.android.providers.media.photopicker.sync.ProactiveSyncWorker } ] 12-31 09:46:16.164531 15196 15412 D OCAM_Performance: onOsenseEventSceneChanged, pressure MEM eventStateType: 2, startTime: 1767145529335, currentAvailmem: 589, killTriggerMem: 1800, memLevel: 3 12-31 09:46:16.164574 15196 16860 D OplusTrack-ContentProviderRecorder: content://com.oplus.statistics.provider/track_event use ContentProviderClient from cache 12-31 09:46:16.164596 15196 15412 D OCAM_DcsDataCollectorImpl: setLastShutterDownPreviewTimestamp, previewTimestamp: 0 12-31 09:46:16.164642 15196 15412 D OCAM_ComprehensivePerformance: addClickShutterTime, clickShutterTime: 1767145529911 12-31 09:46:16.164913 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.164945 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.165327 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData 12-31 09:46:16.165875 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.166173 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.166238 6120 6120 D WM-Processor: Processor 21f11473-b4bb-4fba-8c80-7db758f8a202 executed; reschedule = false 12-31 09:46:16.166322 6120 6120 D WM-GreedyScheduler: Stopping tracking for WorkGenerationalId(workSpecId=21f11473-b4bb-4fba-8c80-7db758f8a202, generation=0) 12-31 09:46:16.168033 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.169403 15196 15412 V OCAM_LocationManager: getCurrentLocation, No location received yet. 12-31 09:46:16.169423 15196 15412 V OCAM_GeoManager: current location is null, so use last location 12-31 09:46:16.169435 15196 15412 I OCAM_GeoManager: getCurrentLocation, mlastKnowLocation is already out of date, use last location from system. 12-31 09:46:16.170117 15196 15412 D LocationManagerExtImpl: getLastLocation provider: gps, uid: 10185, com.oplus.camera 12-31 09:46:16.170212 15196 15412 D LocationManagerExtImpl: getLocationByProvider: gps Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.170222 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.170954 1177 1214 E libPowerHal: [getHintRscSize] hint_id 56 cannot be found in PowerScnTbl 12-31 09:46:16.171663 15196 15412 D LocationManagerExtImpl: getLastLocation provider: network, uid: 10185, com.oplus.camera 12-31 09:46:16.171765 15196 15412 D LocationManagerExtImpl: getLocationByProvider: network Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.171777 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.172181 1340 1340 I touch_boost: enable=0, boost_up=0, boost_down=1, render_deboost=0, active_time=100, duration=120, idleprefer(TA,FG)=(0,0), util(TA,FG)=(0,0), freq(c0,c1,c2)=(1300000,1700000,0) 12-31 09:46:16.172256 1340 1340 I mtkpower_client: perf_lock_rel, hdl:24008, tid:1340 12-31 09:46:16.172355 1925 5353 I AppFeature_provider: com.oplus.camera query feature:com.oplus.camera.privacy_compliance from app_feature table. 12-31 09:46:16.174001 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData X 12-31 09:46:16.174391 1340 1340 I touch_boost: set_top_grp_aware 12-31 09:46:16.174412 1340 1340 I mtkpower_client: perf_lock_acq, hdl:24007, dur:2000, num:4, pid:1340, tid:1340 12-31 09:46:16.174474 15196 15412 V OCAM_a_BaseMode: getPictureSize, sizeList: [4096x3072, 4096x2304, 4096x2048, 4096x1872, 4096x1844, 4096x1712, 3840x2176, 3840x2160, 3264x2448, 3072x3072, 2800x1280, 2780x1264, 2560x1920, 2560x1440, 2520x1080, 2412x1080, 2400x1080, 2400x1072, 2400x1028, 2392x1080, 2340x1080, 2304x1728, 2280x1080, 2160x1080, 2134x960, 2100x1200, 2048x1536, 1920x1440, 1920x1088, 1920x1080, 1728x720, 1600x728, 1600x720, 1560x720, 1520x720, 1440x1080, 1440x720, 1296x540, 1280x960, 1280x720, 1152x720, 1088x1088, 1080x720, 960x960, 960x720, 800x400, 720x720, 720x480, 640x480, 352x288, 320x240, 176x144, 4032x3024, 960x1080, 640x720, 640x368, 464x464, 432x240, 320x320] 12-31 09:46:16.174508 15196 15412 V OCAM_SizeUtils: getOptimalSizeByRatio, size: 4096x1844, targetRatio: 2.2222222222222223 precise true 12-31 09:46:16.174552 1177 1261 I [UAH_CLIENT]: UahRelease, handle:38378 12-31 09:46:16.174742 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.174763 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.175154 15196 15412 I OCAM_CameraCore: startCollectDcsCaptureData, builder hash: 69226336 12-31 09:46:16.175331 15196 15412 D OCAM_ComprehensivePerformance: removeClickShutterTime, capture Failed clickShutterTime: 1767145529911 12-31 09:46:16.175498 1340 1340 I mtkpower_client: ret_hdl:24007 12-31 09:46:16.175831 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.181721 15196 15412 V OplusTrack-OplusTrack: onCommon logTag is 200,eventID:shutter_button_click,flagSendTo:1 12-31 09:46:16.181846 15196 15412 D OCAM_ComprehensivePerformance: addClickShutterTime, clickShutterTime: 1767145529963 12-31 09:46:16.182530 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.182563 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.182659 15196 16860 D OplusTrack-ContentProviderRecorder: content://com.oplus.statistics.provider/track_event use ContentProviderClient from cache 12-31 09:46:16.182895 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData 12-31 09:46:16.183594 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.183954 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.184481 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.184524 15196 15412 V OCAM_LocationManager: getCurrentLocation, No location received yet. 12-31 09:46:16.184538 15196 15412 V OCAM_GeoManager: current location is null, so use last location 12-31 09:46:16.184549 15196 15412 I OCAM_GeoManager: getCurrentLocation, mlastKnowLocation is already out of date, use last location from system. 12-31 09:46:16.185718 15196 15412 D LocationManagerExtImpl: getLastLocation provider: gps, uid: 10185, com.oplus.camera 12-31 09:46:16.185804 15196 15412 D LocationManagerExtImpl: getLocationByProvider: gps Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.185814 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.186090 15196 15412 D LocationManagerExtImpl: getLastLocation provider: network, uid: 10185, com.oplus.camera 12-31 09:46:16.186167 15196 15412 D LocationManagerExtImpl: getLocationByProvider: network Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.186174 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.186669 1925 2208 I AppFeature_provider: com.oplus.camera query feature:com.oplus.camera.privacy_compliance from app_feature table. 12-31 09:46:16.187644 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData X 12-31 09:46:16.188089 15196 15412 V OCAM_a_BaseMode: getPictureSize, sizeList: [4096x3072, 4096x2304, 4096x2048, 4096x1872, 4096x1844, 4096x1712, 3840x2176, 3840x2160, 3264x2448, 3072x3072, 2800x1280, 2780x1264, 2560x1920, 2560x1440, 2520x1080, 2412x1080, 2400x1080, 2400x1072, 2400x1028, 2392x1080, 2340x1080, 2304x1728, 2280x1080, 2160x1080, 2134x960, 2100x1200, 2048x1536, 1920x1440, 1920x1088, 1920x1080, 1728x720, 1600x728, 1600x720, 1560x720, 1520x720, 1440x1080, 1440x720, 1296x540, 1280x960, 1280x720, 1152x720, 1088x1088, 1080x720, 960x960, 960x720, 800x400, 720x720, 720x480, 640x480, 352x288, 320x240, 176x144, 4032x3024, 960x1080, 640x720, 640x368, 464x464, 432x240, 320x320] 12-31 09:46:16.188127 15196 15412 V OCAM_SizeUtils: getOptimalSizeByRatio, size: 4096x1844, targetRatio: 2.2222222222222223 precise true 12-31 09:46:16.188331 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.188367 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.188598 1492 11098 D LogKit_DumpUtil: service = activity, cmd = [service, OVoiceManagerService] 12-31 09:46:16.188807 15196 15412 I OCAM_CameraCore: startCollectDcsCaptureData, builder hash: 238107673 12-31 09:46:16.188864 15196 15412 D OCAM_ComprehensivePerformance: removeClickShutterTime, capture Failed clickShutterTime: 1767145529963 12-31 09:46:16.189035 15196 15412 D OCAM_ComprehensivePerformance: addClickShutterTime, clickShutterTime: 1767145529985 12-31 09:46:16.189383 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.189402 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.189688 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData 12-31 09:46:16.190070 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.190355 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.190518 1925 2208 D ActivityManager: freezer override set to true 12-31 09:46:16.190628 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.190658 15196 15412 V OCAM_LocationManager: getCurrentLocation, No location received yet. 12-31 09:46:16.190671 15196 15412 V OCAM_GeoManager: current location is null, so use last location 12-31 09:46:16.190681 15196 15412 I OCAM_GeoManager: getCurrentLocation, mlastKnowLocation is already out of date, use last location from system. 12-31 09:46:16.191031 15196 15412 D LocationManagerExtImpl: getLastLocation provider: gps, uid: 10185, com.oplus.camera 12-31 09:46:16.191089 15196 15412 D LocationManagerExtImpl: getLocationByProvider: gps Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.191097 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.191113 1925 2208 D ActivityManager: freezer override callers: 1925/1000 com.android.server.am.ActiveServices.dumpService:8857 com.android.server.am.ActivityManagerService.doDump:11987 com.android.server.am.ActivityManagerService.-$$Nest$mdoDump:0 com.android.server.am.ActivityManagerService$1.dump:882 com.android.server.utils.PriorityDump.dump:182 12-31 09:46:16.191323 15196 15412 D LocationManagerExtImpl: getLastLocation provider: network, uid: 10185, com.oplus.camera 12-31 09:46:16.191375 15196 15412 D LocationManagerExtImpl: getLocationByProvider: network Location[null 0.00****,0.00**** et=0] 12-31 09:46:16.191383 15196 15412 D LocationManagerExtImpl: getLastLocation containsKey and location 12-31 09:46:16.191762 1925 5353 I AppFeature_provider: com.oplus.camera query feature:com.oplus.camera.privacy_compliance from app_feature table. 12-31 09:46:16.192353 1925 2208 D ActivityManager: freezer override set to false 12-31 09:46:16.194164 1925 2208 D ActivityManager: freezer override callers: 1925/1000 com.android.server.am.ActiveServices.dumpService:8900 com.android.server.am.ActivityManagerService.doDump:11987 com.android.server.am.ActivityManagerService.-$$Nest$mdoDump:0 com.android.server.am.ActivityManagerService$1.dump:882 com.android.server.utils.PriorityDump.dump:182 12-31 09:46:16.203450 6120 6509 D WM-GreedyScheduler: Cancelling work ID 21f11473-b4bb-4fba-8c80-7db758f8a202 12-31 09:46:16.205539 1925 1925 W ProcessStats: Tracking association SourceState{fed8b11 com.oplus.exsystemservice/1000 BFgs #222514} whose proc state 4 is better than process ProcessState{8a99476 system/1000 pkg=com.android.providers.settings (sub)} proc state 9 (28 skipped) 12-31 09:46:16.216237 6120 6509 D WM-GreedyScheduler: Ignoring {WorkSpec: fb418782-5f2c-49e5-b254-68d597a1ead1}. Requires device idle. 12-31 09:46:16.219736 6120 6509 D WM-GreedyScheduler: Ignoring {WorkSpec: eff69438-5964-4607-ab25-9924f4795716}. Requires device idle. 12-31 09:46:16.220538 6120 6509 D WM-BrdcstRcvrCnstrntTrc: BatteryNotLowTracker: unregistering receiver 12-31 09:46:16.223481 11114 11114 D oplus_dump_net: dump info of module: selfcure 12-31 09:46:16.223964 11116 11116 D oplus_dump_net: dump info of module: netcfg 12-31 09:46:16.224905 11116 11116 D oplus_dump_net: create path(/data/debugging/netconfig) failed or path exist with code(-1) 12-31 09:46:16.224933 11116 11116 D oplus_dump_netcfg: -->full_test, log folder = /data/debugging/netconfig 12-31 09:46:16.224950 11116 11116 D oplus_dump_netcfg: folder(/data/debugging/netconfig) exists 12-31 09:46:16.224958 11116 11116 D oplus_dump_netcfg: location_stop at |/data/debugging/netconfig/dump-networking-config.txt| 12-31 09:46:16.227885 11116 11116 D oplus_dump_netcfg: netcfg open at (/data/debugging/netconfig/dump-networking-config.txt) of fd(4) 12-31 09:46:16.227914 11116 11116 D oplus_dump_netcfg: open dump_stop.txt 4,temp_fd:5 12-31 09:46:16.227918 11116 11116 D oplus_dump_netcfg: after dup2 dump_stop.txt 4,temp_fd:5,temp_fd2:1 12-31 09:46:16.228188 11114 11114 D oplus_dump_net: create path(/data/debugging/netconfig) failed or path exist with code(-1) 12-31 09:46:16.228216 11114 11114 D oplus_dump_netcfg: -->full_test, log folder = /data/debugging/netconfig 12-31 09:46:16.228233 11114 11114 D oplus_dump_netcfg: folder(/data/debugging/netconfig) exists 12-31 09:46:16.228241 11114 11114 D oplus_dump_netcfg: location_stop at |/data/debugging/netconfig/dump-oplusnetinfo.txt| 12-31 09:46:16.228809 11114 11114 D oplus_dump_netcfg: current netinfo log_size(214972) Bytes, fd(4) 12-31 09:46:16.228822 11114 11114 D oplus_dump_netcfg: open dump_stop.txt 4,temp_fd:5 12-31 09:46:16.228826 11114 11114 D oplus_dump_netcfg: after dup2 dump_stop.txt 4,temp_fd:5,temp_fd2:1 12-31 09:46:16.245895 4780 11290 D RadioProxyJ[0]: startChannelMonitoring update mLatestRequestId:-1 12-31 09:46:16.255114 4780 11291 D RadioProxyJ[1]: startChannelMonitoring update mLatestRequestId:-1 12-31 09:46:16.256773 1925 4744 D Osense-ReentrantPolicy: bundle: Bundle[{stateType=update, type=instantcpuload, instantCpuLoad=92}] 12-31 09:46:16.256840 1925 4744 D OsenseResEventManager: handleOsenseResultEvent: OsenseEventResult : eventType is :113 eventStateType is :2 ExtraData is : Bundle[{instantCpuLoad=92}] 12-31 09:46:16.257157 1925 4338 D OsenseResEventManager: onEventSceneChanged: eventType(113) Callback{mCallback=com.oplus.osense.eventinfo.IOsenseEventCallback$Stub$Proxy@33dc40, mCallingPid=15196, mCallingUid=10185, mLastMemLevel=3, mLastIoLevel=1, mEventTypeSet=[113, 103, 104, 105], mOsenseConfigSet=[OsenseConfig{mEventType=113, mExtra=null}, OsenseConfig{mEventType=103, mExtra=null}, OsenseConfig{mEventType=104, mExtra=null}, OsenseConfig{mEventType=105, mExtra=null}, OsenseConfig{mEventType=109, mExtra=Bundle[{topApps=Supplier{VAL_LIST@24+164}, firstNotifyFlag=true}]}, OsenseConfig{mEventType=110, mExtra=Bundle[{firstNotifyFlag=true}]}, OsenseConfig{mEventType=111, mExtra=Bundle[{firstNotifyFlag=true, psiMemControlLevel=2}]}, OsenseConfig{mEventType=112, mExtra=Bundle[{firstNotifyFlag=true, psiIoControlLevel=2}]}]} 12-31 09:46:16.257464 15196 15447 V OCAM_Performance: onOsenseEventSceneChanged, event: 113 12-31 09:46:16.257553 15196 15447 V OCAM_Performance: onOsenseEventSceneChanged, [extra] startTime: 1767145576256 12-31 09:46:16.257566 15196 15447 V OCAM_Performance: onOsenseEventSceneChanged, [extra] instantCpuLoad: 92 12-31 09:46:16.262022 1154 9753 D C2MtkVenc: [0xB400007EB980E800] IDR frame produced 12-31 09:46:16.266304 15196 15412 D OCAM_DcsDataCollectorImpl: prepareRealTimeDcsMsgData X 12-31 09:46:16.270267 3098 5160 D AudioBoost: doGetWakethreadAndBoost pid 1755, tid 10026, handle 1480, isWakeee 1 12-31 09:46:16.270373 3098 5160 D AudioBoost: doGetWakethreadAndBoost id 181, pid 1755 had stoped, cancle tracing thread and boost. 12-31 09:46:16.270211 15196 15412 V OCAM_a_BaseMode: getPictureSize, sizeList: [4096x3072, 4096x2304, 4096x2048, 4096x1872, 4096x1844, 4096x1712, 3840x2176, 3840x2160, 3264x2448, 3072x3072, 2800x1280, 2780x1264, 2560x1920, 2560x1440, 2520x1080, 2412x1080, 2400x1080, 2400x1072, 2400x1028, 2392x1080, 2340x1080, 2304x1728, 2280x1080, 2160x1080, 2134x960, 2100x1200, 2048x1536, 1920x1440, 1920x1088, 1920x1080, 1728x720, 1600x728, 1600x720, 1560x720, 1520x720, 1440x1080, 1440x720, 1296x540, 1280x960, 1280x720, 1152x720, 1088x1088, 1080x720, 960x960, 960x720, 800x400, 720x720, 720x480, 640x480, 352x288, 320x240, 176x144, 4032x3024, 960x1080, 640x720, 640x368, 464x464, 432x240, 320x320] 12-31 09:46:16.270461 15196 15412 V OCAM_SizeUtils: getOptimalSizeByRatio, size: 4096x1844, targetRatio: 2.2222222222222223 precise true 12-31 09:46:16.270716 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.270769 15196 15412 D OCAM_WatermarkModel: isAiMasterWatermarkFeatureSupport-aiMaster, isAiMasterWatermarkSupport: true 12-31 09:46:16.271085 15196 15412 I OCAM_CameraCore: startCollectDcsCaptureData, builder hash: 261907678 12-31 09:46:16.271202 15196 15412 D OCAM_ComprehensivePerformance: removeClickShutterTime, capture Failed clickShutterTime: 1767145529985 12-31 09:46:16.271881 15196 15412 V OplusTrack-OplusTrack: onCommon logTag is 207,eventID:functional_error,flagSendTo:1 12-31 09:46:16.272016 15196 15412 D OCAM_Performance: onOsenseEventSceneChanged, pressure MEM eventStateType: 2, startTime: 1767145530309, currentAvailmem: 582, killTriggerMem: 1800, memLevel: 1 12-31 09:46:16.272044 15196 15412 D OCAM_Performance: onOsenseEventSceneChanged, pressure MEM eventStateType: 2, startTime: 1767145530422, currentAvailmem: 578, killTriggerMem: 1800, memLevel: 3 12-31 09:46:16.272135 15196 16860 D OplusTrack-ContentProviderRecorder: content://com.oplus.statistics.provider/track_event use ContentProviderClient from cache 12-31 09:46:16.272632 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.286585 15196 15412 V OplusTrack-OplusTrack: onCommon logTag is 204,eventID:fluency_performance,flagSendTo:1 12-31 09:46:16.287569 15196 16860 D OplusTrack-ContentProviderRecorder: content://com.oplus.statistics.provider/track_event use ContentProviderClient from cache 12-31 09:46:16.290763 1925 5417 V SettingsShellCmd: putForUser(userId=0, table=system, key=log_switch_type, value=0, tag=null, makeDefault=false, overrideableByRestore=false) 12-31 09:46:16.291103 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.295628 1925 4744 I OplusCpuLimitManager: OplusCpuHighLoad: newLoadLevel=2, newMngLevel=2, (nl_load=2, nl_thermal=1, nl_scene=1), curMngLevel=2, CL=89, curWinCL=89, curShortWinCL= 87, latestCL=78, latestThermalLevel=4, expHlScene=false 12-31 09:46:16.297332 12610 12629 D OplusWallpaperLogUtils: updateLogState on = false 12-31 09:46:16.298429 566 566 E lowmemorykiller: device has enough memory 1703408Kib, freeMemory 292132Kib, cmafree 728Kib, file_cache 1376312Kib, disable killing (limit_killing:1258288Kib) 12-31 09:46:16.299526 1925 2210 D CompressAction: handleExitHighLoad: last=92 cur=78 12-31 09:46:16.303402 15196 15412 V OCAM_Performance: requestInstantCpuLoad, sCpuSampleCount++: 34 12-31 09:46:16.304273 1925 2208 I OplusCpuLimitManager: OplusCpuHighLoad: request instant cpu load 12-31 09:46:16.304876 1271 1271 I OplusRequestedLayerState: setFlags sequence=19675, flags[0x00000000], mask[0x00000001], newFlags[0x00000001], name=Sprite#19675 12-31 09:46:16.306026 15196 15412 D OCAM_ComprehensivePerformance: onCaptureStarted, performance before gap: 4377, shutterTime: 1767145529012, sLastCaptureTimestamp: 1767145529012 12-31 09:46:16.306082 15196 15412 D OCAM_ComprehensivePerformance: onCaptureStarted, time: 1767145530657, captureIdentity: 479921604218999, shutterClickTimestamp: 1767145529012, shutterDownPreviewTimestamp: 479921637538999, sShutterCaptureStartTime: 1767145529012, featureType: 55, bracketMode: 0, luxValue: 237, isoValue: 100, evList: null, MFSRCount: 0, preCollectCount: 0, frameCount: 1 12-31 09:46:16.306147 15196 15412 D OCAM_ComprehensivePerformance: onCaptureFirstFrameArrived, sendRequestTimestamp: 1767145529069, captureId: 44, flashDuration: Pair{0 false} 12-31 09:46:16.306193 15196 15412 I OCAM_ComprehensivePerformance: onFirstFrameArrived, no animateTakePictureTimestamp in queue 12-31 09:46:16.306431 15196 15412 D OCAM_ComprehensivePerformance: addShowThumbnailTimestamp, shutterTime:1767145529012, sThumbWithShutterTimeMap: {1767145417160=1637, 1767145441419=795, 1767145411533=310, 1767145444032=246, 1767145362820=692, 1767145349912=990, 1767145496795=261, 1767145282719=433, 1767145259485=264, 1767145521491=78, 1767145429781=157, 1767145355887=2289, 1767145346721=236, 1767145493990=94, 1767145488677=208, 1767145392354=173, 1767145285606=288, 1767145385981=267, 1767145376382=168, 1767145434239=283, 1767145502583=907, 1767145400819=203, 1767145529012=1705, 1767145374261=194, 1767145516528=212}, sShutterTimeExecMap: {1767145377672=0, 1767145447820=0, 1767145381249=0, 1767145455491=0, 1767145445764=0, 1767145381764=0, 1767145417095=0, 1767145439129=0, 1767145445273=0, 1767145417114=0, 1767145441178=0, 1767145387932=0, 1767145443741=0, 1767145527193=0, 1767145351070=0, 1767145445777=0, 1767145349011=0, 1767145447828=0, 1767145447318=0, 1767145523088=0, 1767145524112=0, 1767145525648=0, 1767145380777=0, 1767145441194=0, 1767145445802=0, 1767145447852=0, 1767145381804=0, 1767145524136=0, 1767145452962=0, 1767145383844=0, 1767145440677=0, 1767145524159=0, 1767145455033=0, 1767145443770=0, 1767145295806=0, 1767145440700=0, 1767145445308=0, 1767145351103=0, 1767145441214=0, 1767145452990=0, 1767145523129=0, 1767145278397=0, 1767145439156=0, 1767145491379=0, 1767145527219=0, 1767145447349=0, 1767145529265=0, 1767145443784=0, 1767145344975=0, 1767145447887=0, 1767145383873=0, 1767145445825=0, 1767145380803=0, 1767145381827=0, 1767145447876=0, 1767145404358=0, 1767145383896=0, 1767145295832=0, 1767145295326=0, 1767145381854=0, 1767145524183=0, 1767145448913=0, 1767145455570=0, 1767145491412=0, 1767145445845=0, 1767145448429=0, 1767145523171=0, 1767145404390=0, 1767145527294=0, 1767145345018=0, 1767145417712=0, 1767145365491=0, 1767145383923=0, 1767145524213=0, 1767145407477=0, 1767145350921=0, 1767145449736=0, 1767145369352=0, 1767145388811=0, 1767145347338=0, 1767145381132=0, 1767145401615=0, 1767145446158=0, 1767145380110=0, 1767145526024=0, 1767145528581=0, 1767145527044=0, 1767145403160=0, 1767145446682=0, 1767145440539=0, 1767145388829=0, 1767145407772=0, 1767145403152=0, 1767145377555=0, 1767145526036=0, 1767145366292=0, 1767145449749=0, 1767145527058=0, 1767145418518=0, 1767145455894=0, 1767145449768=0, 1767145527086=0, 1767145443114=0, 1767145350957=0, 1767145526059=0, 1767145347375=0, 1767145455918=0, 1767145348910=0, 1767145503528=0, 1767145414944=0, 1767145369376=0, 1767145377571=0, 1767145526052=0, 1767145401636=0, 1767145403175=0, 1767145527073=0, 1767145491262=0, 1767145521468=0, 1767145380668=0, 1767145377585=0, 1767145525559=0, 1767145414961=0, 1767145447217=0, 1767145528117=0, 1767145366322=0, 1767145445683=0, 1767145446708=0, 1767145381175=0, 1767145445193=0, 1767145403211=0, 1767145443660=0, 1767145455437=0, 1767145527111=0, 1767145380163=0, 1767145407810=0, 1767145455938=0, 1767145526085=0, 1767145446724=0, 1767145439045=0, 1767145377625=0, 1767145381209=0, 1767145527134=0, 1767145403226=0, 1767145407835=0, 1767145445725=0, 1767145455966=0, 1767145520984=0, 1767145527125=0, 1767145525587=0, 1767145491282=0, 1767145380694=0, 1767145377641=0, 1767145380202=0, 1767145407851=0, 1767145445742=0, 1767145447790=0, 1767145446752=0, 1767145525607=0, 1767145527143=0, 1767145380704=0, 1767145491302=0, 1767145503589=0, 1767145387877=0, 1767145525630=0, 1767145407868=0, 1767145443709=0, 1767145348991=0, 1767145358718=0, 1767145527160=0, 1767145439090=0, 1767145387893=0, 1767145358984=0, 1767145527947=0, 1767145442957=0, 1767145449614=0, 1767145390734=0, 1767145418368=0, 1767145296512=0, 1767145287297=0, 1767145529985=0, 1767145437848=0, 1767145296539=0, 1767145390750=0, 1767145527958=0, 1767145388693=0, 1767145454249=0, 1767145527982=0, 1767145390765=0, 1767145437860=0, 1767145366182=0, 1767145449656=0, 1767145369275=0, 1767145366205=0, 1767145296562=0, 1767145529527=0, 1767145401523=0, 1767145437363=0, 1767145529012=1, 1767145406152=0, 1767145528012=0, 1767145390784=0, 1767145296579=0, 1767145454275=0, 17671 12-31 09:46:16.306537 15196 15412 D OCAM_DcsDataCollectorImpl: setLastShutterDownPreviewTimestamp, previewTimestamp: 0 12-31 09:46:16.306580 15196 15412 D OCAM_ComprehensivePerformance: getCaptureDeferPerformanceData, identity: 479921604218999 12-31 09:46:16.306595 15196 15412 D OCAM_ComprehensivePerformance: getCaptureDeferPerformanceData, invalid record for identity 479921604218999 12-31 09:46:16.306642 15196 15412 D OCAM_ComprehensivePerformance: addClickShutterTime, clickShutterTime: 1767145530766 12-31 09:46:16.307240 15196 15412 D HoraeHelper: ambientThermal:-2147483648 12-31 09:46:16.310318 1925 2238 D InputManagerServiceExtImpl: switchVerbose, curr=true 12-31 09:46:16.310824 1925 2238 D InputLog: dynamicLog, level = 0 12-31 09:46:16.319102 1523 1662 W gaia:json_util: [getJsonKey:116]key feature is not found 12-31 09:46:16.319167 1523 1662 D gaia:LogWorkManager: [handleCameraDump:963]copy camera dump 12-31 09:46:16.319201 1523 1662 D gaia:LogWorkManager: [handleCameraDump:974]isUserMode, copy image file 12-31 09:46:16.319762 1925 1925 W Looper : Slow dispatch took 114ms main app=system_server main=true group=SKIP h=android.app.ActivityThread$H c=android.app.LoadedApk$ServiceDispatcher$RunConnection@775e60 m=0 12-31 09:46:16.322868 1523 1662 D gaia:LogWorkManager: [preStopOrTransfer:562]set sys.olc.transfer.path to 2025-12-31_09-46-16@camera 12-31 09:46:16.328645 1925 2238 D InputManagerServiceExtImpl: requestNativeConfigLog : 0, call from:com.android.server.input.InputManagerServiceExtImpl.dynamicNativeConfigLog:958 com.android.server.input.InputManagerServiceExtImpl.switchVerbose:911 相机连拍卡顿和这部分log有关系吗

filetype

帮我分析一下下面的代码,并帮我改正,写出修改后的代码: # 获取所有用户评论的文本 def get_comments_for_user(user): comments = AnnouncementComment.objects.filter(user=user) return [comment.content for comment in comments] # 获取用户收藏的宠物列表 def get_favorites_for_user(user): favorites = Favorite.objects.filter(user=user) return [favorite.pet.id for favorite in favorites] # 使用 TF-IDF 计算两个用户之间评论的相似度 def calculate_comment_similarity(user1, user2): user1_comments = get_comments_for_user(user1) user2_comments = get_comments_for_user(user2) # 如果有空评论则返回相似度为 0 if not user1_comments or not user2_comments: return 0 # 合并用户1和用户2的评论 all_comments = user1_comments + user2_comments tfidf = TfidfVectorizer(stop_words='english') tfidf_matrix = tfidf.fit_transform(all_comments) # 计算余弦相似度 similarity_matrix = cosine_similarity(tfidf_matrix) # 返回用户1和用户2之间的相似度 return similarity_matrix[0][0] # 用户1和用户2之间的相似度 # 计算两个用户之间的收藏相似度 def calculate_favorite_similarity(user1, user2): user1_favorites = get_favorites_for_user(user1) user2_favorites = get_favorites_for_user(user2) # 如果任一用户没有收藏任何宠物,返回相似度为 0 if len(user1_favorites) == 0 or len(user2_favorites) == 0: return 0 # 计算收藏宠物的重合度 common_favorites = set(user1_favorites).intersection(user2_favorites) similarity = len(common_favorites) / (len(user1_favorites) + len(user2_favorites) - len(common_favorites)) return similarity # 基于时间的加权相似度计算 def calculate_time_weighted_similarity(user1, user2): user1_comments = AnnouncementComment.objects.filter(user=user1).order_by('-created_at') user2_comments = AnnouncementComment.objects.filter(user=user2).order_by('-created_at') # 如果任一用户没有评论,返回相似度为 0 if len(user1_comments) == 0 or len(user2_comments) == 0: return 0 # 给最近的评论更多权重 time_weighted_similarity = 0 total_weight1 = sum([math.exp(-0.1 * i) for i in range(len(user1_comments))]) # 时间衰减权重 total_weight2 = sum([math.exp(-0.1 * i) for i in range(len(user2_comments))]) # 计算时间加权的相似度 for i, comment1 in enumerate(user1_comments): for j, comment2 in enumerate(user2_comments): # 计算评论的相似度,按时间加权 tfidf = TfidfVectorizer(stop_words='english') tfidf_matrix = tfidf.fit_transform([comment1.content, comment2.content]) similarity = cosine_similarity(tfidf_matrix)[0][1] # 加入时间权重 time_weighted_similarity += similarity * math.exp(-0.1 * i) * math.exp(-0.1 * j) # 返回时间加权的相似度 return time_weighted_similarity / (total_weight1 * total_weight2) # 综合评论、收藏和时间相似度 def get_user_similarity(user1, user2): comment_similarity = calculate_comment_similarity(user1, user2) favorite_similarity = calculate_favorite_similarity(user1, user2) time_similarity = calculate_time_weighted_similarity(user1, user2) # 将评论、收藏和时间的相似度加权 return 0.5 * comment_similarity + 0.3 * favorite_similarity + 0.2 * time_similarity # 基于用户相似度推荐宠物 def recommend_pets(user): users = CustomUser.objects.all() user_similarities = [] # 计算当前用户与所有其他用户的相似度 for other_user in users: if other_user != user: similarity = get_user_similarity(user, other_user) user_similarities.append((other_user, similarity)) # 按照相似度排序用户 user_similarities = sorted(user_similarities, key=lambda x: x[1], reverse=True) # 获取与最相似的用户相关的宠物 recommended_pets = set() for other_user, similarity in user_similarities[:5]: # 取前5个最相似的用户 other_user_favorites = get_favorites_for_user(other_user) recommended_pets.update(other_user_favorites) # 返回推荐的宠物 return Pet.objects.filter(id__in=recommended_pets)

filetype

import curses import requests from bs4 import BeautifulSoup from urllib.parse import urljoin import os # 文件路径 FAVORITES_FILE = 'favorites.txt' HISTORY_FILE = 'history.txt' # 加载数据 def load_list(filename): try: with open(filename, 'r', encoding='utf-8') as f: return [line.strip() for line in f if line.strip()] except FileNotFoundError: return [] # 保存数据 def save_list(filename, items): with open(filename, 'w', encoding='utf-8') as f: for item in items: f.write(item + '\n') # 获取网页纯文本 def fetch_page(url): try: res = requests.get(url, timeout=5) res.raise_for_status() soup = BeautifulSoup(res.text, 'html.parser') for tag in soup(['script', 'style']): tag.decompose() return soup.get_text() except Exception as e: return f"加载失败: {e}" # 提取超链接和表单(扩展版) def extract_links_and_forms(html, base_url): soup = BeautifulSoup(html, 'html.parser') # 提取超链接 links = [] for a in soup.find_all('a', href=True): href = a['href'] if not href.startswith('http'): href = urljoin(base_url, href) links.append((href, a.get_text(strip=True))) # 提取表单 forms = [] for form in soup.find_all('form'): action = form.get('action', '') if not action.startswith('http'): action = urljoin(base_url, action) method = form.get('method', 'get').lower() inputs = [] # 提取所有输入字段 for input_tag in form.find_all(['input', 'textarea', 'select']): name = input_tag.get('name') if not name: continue input_type = input_tag.get('type', 'text') value = input_tag.get('value', '') required = input_tag.has_attr('required') placeholder = input_tag.get('placeholder', '') if input_tag.name == 'textarea': input_type = 'textarea' value = input_tag.get_text() elif input_tag.name == 'select': input_type = 'select' options = [(opt.get('value') or opt.text, opt.text) for opt in input_tag.find_all('option')] inputs.append({ 'name': name, 'type': input_type, 'value': value, 'required': required, 'placeholder': placeholder, 'options': options }) continue # 处理 checkbox 和 radio if input_type == 'checkbox' or input_type == 'radio': inputs.append({ 'name': name, 'type': input_type, 'value': value, 'checked': input_tag.has_attr('checked'), 'required': required }) continue inputs.append({ 'name': name, 'type': input_type, 'value': value, 'required': required, 'placeholder': placeholder }) forms.append((action, method, inputs)) return links, forms # 输入框 def input_box(stdscr, prompt): curses.echo() stdscr.clear() stdscr.addstr(0, 0, prompt) stdscr.refresh() input_str = stdscr.getstr(1, 0).decode('utf-8') curses.noecho() return input_str # 提交表单(扩展版) def submit_form(stdscr, form): action, method, inputs = form data = {} for field in inputs: name = field['name'] input_type = field['type'] required = field.get('required', False) placeholder = field.get('placeholder', '') value = field.get('value', '') prompt = f"{name}" if placeholder: prompt += f"(提示:{placeholder})" if required: prompt += " [必填]" if input_type == 'select': options = field['options'] stdscr.clear() stdscr.addstr(0, 0, f"请选择 {name}:") for i, (val, text) in enumerate(options): stdscr.addstr(i + 1, 0, f"{i + 1}. {text}") stdscr.refresh() idx = int(stdscr.getstr(len(options) + 2, 0).decode('utf-8')) - 1 data[name] = options[idx][0] elif input_type == 'checkbox': checked = field.get('checked', False) res = input_box(stdscr, f"{name} [复选框] 是否选中?(y/n):") data[name] = 'on' if res.lower() == 'y' else '' elif input_type == 'radio': res = input_box(stdscr, f"{name} [单选] 是否选中?(y/n):") data[name] = value if res.lower() == 'y' else '' else: default = value if value else '' user_input = input_box(stdscr, f"{prompt}:") data[name] = user_input if user_input else default try: if method == 'post': res = requests.post(action, data=data) else: res = requests.get(action, params=data) return res.text except Exception as e: return f"表单提交失败:{e}" # 收藏夹菜单 def favorites_menu(stdscr, favorites, current_url): while True: options = ["新添", "删除", "退出"] action = show_list(stdscr, options, "收藏夹", options) if action == 0: # 新添 if current_url not in favorites: favorites.append(current_url) save_list(FAVORITES_FILE, favorites) elif action == 1: # 删除 if favorites: idx = show_list(stdscr, favorites, "选择要删除的收藏") if idx >= 0: favorites.pop(idx) save_list(FAVORITES_FILE, favorites) elif action == 2 or action == -1: break # 历史记录菜单 def history_menu(stdscr, history): while True: options = ["清空", "退出"] action = show_list(stdscr, options, "历史记录", options) if action == 0: # 清空 history.clear() save_list(HISTORY_FILE, history) elif action == 1 or action == -1: break elif action >= 0: return history[action] return None # 显示列表(收藏夹/历史记录) def show_list(stdscr, items, title, actions=None): selected = 0 while True: stdscr.clear() stdscr.addstr(0, 0, title) if actions: stdscr.addstr(0, len(title) + 2, f"| {' | '.join(actions)}") stdscr.addstr(1, 0, "-" * 50) for i, item in enumerate(items): if i == selected: stdscr.attron(curses.A_REVERSE) stdscr.addstr(i + 2, 0, f"{i + 1}. {item}") if i == selected: stdscr.attroff(curses.A_REVERSE) stdscr.addstr(len(items) + 3, 0, "方向键选择,Enter确认,q退出") stdscr.refresh() key = stdscr.getch() if key == curses.KEY_UP and selected > 0: selected -= 1 elif key == curses.KEY_DOWN and selected < len(items) - 1: selected += 1 elif key == ord('\n'): return selected elif key == ord('q'): return -1 def main(stdscr): curses.curs_set(0) # 隐藏光标 favorites = load_list(FAVORITES_FILE) history = load_list(HISTORY_FILE) # 初始页面加载 current_url = input_box(stdscr, "请输入网址:") page_text = fetch_page(current_url) if current_url not in history: history.append(current_url) if len(history) > 20: history.pop(0) save_list(HISTORY_FILE, history) # 初始数据 menu_options = ["收藏夹", "新的网页", "历史记录"] selected_menu = 0 links, forms = extract_links_and_forms(page_text, current_url) selected_link = 0 selected_form = 0 mode = "menu" # 当前模式:menu, link, form while True: stdscr.clear() h, w = stdscr.getmaxyx() # 显示顶部菜单 for i, opt in enumerate(menu_options): x = 2 + i * 15 if mode == "menu" and i == selected_menu: stdscr.attron(curses.A_REVERSE) stdscr.addstr(0, x, opt) if mode == "menu" and i == selected_menu: stdscr.attroff(curses.A_REVERSE) stdscr.addstr(1, 0, "-" * w) # 显示网页内容 lines = page_text.split('\n') for i, line in enumerate(lines[:h - 10]): stdscr.addstr(i + 2, 0, line[:w - 1]) # 显示超链接 stdscr.addstr(h - 8, 0, "超链接:") for i, (url, text) in enumerate(links): label = f"{i + 1}. {text[:30]}..." if mode == "link" and i == selected_link: stdscr.attron(curses.A_REVERSE) stdscr.addstr(h - 7 + i, 0, label[:w - 1]) if mode == "link" and i == selected_link: stdscr.attroff(curses.A_REVERSE) # 显示表单 stdscr.addstr(h - 7 + len(links) + 1, 0, "表单:") for i, (action, method, inputs) in enumerate(forms): label = f"表单 {i + 1}: {method.upper()} {action[:30]}..." if mode == "form" and i == selected_form: stdscr.attron(curses.A_REVERSE) stdscr.addstr(h - 6 + len(links) + i + 1, 0, label[:w - 1]) if mode == "form" and i == selected_form: stdscr.attroff(curses.A_REVERSE) # 底部提示 stdscr.addstr(h - 1, 0, "方向键选择,Enter确认,q返回,Tab切换区域") stdscr.refresh() # 用户输入处理 key = stdscr.getch() if key == ord('q'): break elif key == ord('\t'): # 切换模式:菜单 -> 链接 -> 表单 -> 菜单 if mode == "menu": mode = "link" elif mode == "link": mode = "form" else: mode = "menu" elif key == curses.KEY_UP: if mode == "menu" and selected_menu > 0: selected_menu -= 1 elif mode == "link" and selected_link > 0: selected_link -= 1 elif mode == "form" and selected_form > 0: selected_form -= 1 elif key == curses.KEY_DOWN: if mode == "menu" and selected_menu < len(menu_options) - 1: selected_menu += 1 elif mode == "link" and selected_link < len(links) - 1: selected_link += 1 elif mode == "form" and selected_form < len(forms) - 1: selected_form += 1 elif key == ord('\n'): if mode == "menu": if selected_menu == 0: favorites_menu(stdscr, favorites, current_url) elif selected_menu == 1: current_url = input_box(stdscr, "请输入网址:") page_text = fetch_page(current_url) if current_url not in history: history.append(current_url) if len(history) > 20: history.pop(0) save_list(HISTORY_FILE, history) links, forms = extract_links_and_forms(page_text, current_url) elif selected_menu == 2: selected_url = history_menu(stdscr, history) if selected_url: current_url = selected_url page_text = fetch_page(current_url) links, forms = extract_links_and_forms(page_text, current_url) elif mode == "link": if links: current_url = links[selected_link][0] page_text = fetch_page(current_url) links, forms = extract_links_and_forms(page_text, current_url) elif mode == "form": if forms: result = submit_form(stdscr, forms[selected_form]) page_text = result links, forms = extract_links_and_forms(page_text, current_url) return # 启动程序 if __name__ == "__main__": curses.wrapper(main) 这是我的纯文本浏览器的源代码。它报错了:Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. = RESTART: C:\Users\number one\Desktop\纯文本浏览器.py Traceback (most recent call last): File "C:\Users\number one\Desktop\纯文本浏览器.py", line 363, in <module> curses.wrapper(main) File "C:\Users\number one\AppData\Local\Programs\Python\Python311\Lib\curses\__init__.py", line 73, in wrapper stdscr = initscr() File "C:\Users\number one\AppData\Local\Programs\Python\Python311\Lib\curses\__init__.py", line 30, in initscr fd=_sys.__stdout__.fileno()) AttributeError: 'NoneType' object has no attribute 'fileno'

缪建明
  • 粉丝: 63
上传资源 快速赚钱