22from pathlib import Path
33from enum import StrEnum
44import weakref
5- from Plugins .Profilers .DataSource import CLISource , ParameterDict , Logfile
5+ from Plugins .Profilers .DataSource import CLISource , ParameterDict , ValueRef
66
77# How to format the output
88class PLFormatTypes (StrEnum ):
@@ -20,7 +20,7 @@ class PLOrderTypes(StrEnum):
2020# ("-h", "--help"): None, # Dont support this
2121 ("-i" , "--sample-rate" ): int ,
2222 ("-n" , "--sample-count" ): int ,
23- ("-o" , "--output-file" ): Logfile ,
23+ ("-o" , "--output-file" ): ValueRef ,
2424 ("-r" , "--order" ): PLOrderTypes ,
2525 ("-A" , "--show-all" ): None ,
2626 ("--show-process-io" ): None ,
@@ -48,14 +48,16 @@ class PowerLetrics(CLISource):
4848
4949 def __init__ (self ,
5050 sample_frequency : int = 1000 ,
51- out_file : Path = "pm_out .plist" ,
51+ out_file : Path = "pl_out .plist" ,
5252 additional_args : dict = {},
5353 order : PLOrderTypes = PLOrderTypes .PL_ORDER_CPU ):
5454
5555 super ().__init__ ()
56+
57+ print (self ._logfile )
5658
5759 self .requires_admin = True
58- self ._logfile = Logfile ( out_file )
60+ self .logfile = out_file
5961
6062 self .args = {
6163 "--output-file" : self ._logfile ,
@@ -67,14 +69,6 @@ def __init__(self,
6769 }
6870
6971 self .update_parameters (add = additional_args )
70-
71- @property
72- def logfile (self ):
73- return self ._logfile .file
74-
75- @logfile .setter
76- def logfile (self , value ):
77- self ._logfile .file = value
7872
7973 @staticmethod
8074 def parse_log (logfile : Path ):
0 commit comments