mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	Inheritance from base_profile works
Signed-off-by: Dipti <dipti.dhond@candelatech.com>
This commit is contained in:
		| @@ -4,6 +4,10 @@ import re | ||||
| import time | ||||
| import pprint | ||||
| import csv | ||||
| import datetime | ||||
| import random | ||||
| import string | ||||
| from pprint import pprint | ||||
| #from LANforge.lfcriteria import LFCriteria | ||||
|  | ||||
| class BaseProfile: | ||||
| @@ -53,6 +57,33 @@ class BaseProfile: | ||||
|  | ||||
|     def logg(self, message=None): | ||||
|         self.parent_realm.logg(message) | ||||
|      | ||||
|  | ||||
|     def replace_special_char(self, | ||||
|                              str): | ||||
|         return str.replace('+', ' ').replace('_', ' ').strip(' ') | ||||
|      | ||||
|     def get_milliseconds(self, | ||||
|                          timestamp): | ||||
|         return (timestamp - datetime.datetime(1970,1,1)).total_seconds()*1000 | ||||
|     def get_seconds(self, | ||||
|                     timestamp): | ||||
|         return (timestamp - datetime.datetime(1970,1,1)).total_seconds() | ||||
|     def read_file(self, | ||||
|                   filename): | ||||
|         #Convert file contents to a list | ||||
|         filename = open(filename, 'r') | ||||
|         return [line.split(',') for line in filename.readlines()] | ||||
|  | ||||
|     def random_chars(self, | ||||
|                      size, | ||||
|                      chars=None): | ||||
|         #Create random characters made of letters | ||||
|         if chars is None: | ||||
|             chars = string.ascii_letters | ||||
|         return ''.join(random.choice(chars) for x in range(size)) | ||||
|  | ||||
|  | ||||
|  | ||||
|     # #Find file path to save data/csv to: | ||||
|     #     if args.report_file is None: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dipti
					Dipti