| |
- LSM_translate(line, center)
- Convert size and style of each line in input plaintext
:param line: the input line.
:param center: flag of putting text in center
:type center:bool
:type line:str
:return : return a list contain text,header_end and header_begin
- address_print()
- Print the working directory
:return:None
- build_index(file)
- Find and build index page
:param file: The index file.
:type file:_io.TextIOWrapper
:return:None
- build_resume(file)
- Find and build resume page.
:param file: The resume file.
:type file:_io.TextIOWrapper
:return:None
- clear_folder(path)
- This function get path of folder and delete its contains
:param path: the path that gonna be deleted.
:type path:str
:return: None
- close_files()
- Close all the files.
:return:None
- color_code_map()
- Check and insert colors that is chosen.
:return list: background and text color
- contain(name)
- Main function that open each page HTML file and call other function to write data in it
:param name: the name of the file that should be written
:type name:str
:return:None
- convert_bytes(num)
- convert num to idiomatic byte unit
:param num: the input number.
:type num:int
:return: str
>>> convert_bytes(200)
'200.0 bytes'
>>> convert_bytes(6000)
'5.9 KB'
>>> convert_bytes(80000)
'78.1 KB'
- create_badge(subject='qpage', status='1.9', color='blue', random=False)
- this function use shields.io template for creating badges
:param subject: badge subject
:param status: badge status ( in our case version)
:param color: badge color
:param random: randomization flag
:type subject:str
:type status:str
:type color:str
:type random:bool
:return: shields.io badge addresses as string
>>> create_badge()
'https://img.shields.io/badge/qpage-1.9-blue.svg'
>>> random.seed(1)
>>> create_badge(random=True)
'https://img.shields.io/badge/qpage-1.9-yellowgreen.svg'
- create_folder()
- This Function Create Empty Folder At Begin
:return:folder status as boolean
- css_creator()
- Ask For background and text color in and make css base
:return:None
- css_font(font_folder)
- Search and file all fonts.
:param font_folder: the folder to search.
:type font_folder:list
:return list : font_flag and the current format
- download_badge(address)
- Download badge for website
:param address: the address that should get badge
:type address : str
:return: None
- download_lorem()
- Download the lorem file
:return: None
- email_at(text, USE_RE=False, replace_char=' at ')
- :param text: input text of pages
:param USE_RE: flag for using regular expression (default False)
:param replace_char: replace char for @
:type text:str
:type USE_RE:bool
:type replace_char:str
:return: replaced string
>>> email_at("example@yahoo.com")
'example at yahoo.com'
>>>
- enter_to_exit()
- Quit Project by pressing a key.
:return:None
- error_finder()
- Check and find error that display it
:return : error and pass vector as list
- error_log(msg)
- Create the errorlog of the app
:param msg: error message
:type msg:str
- file_size()
- Print the size of output file
:return: None
>>> file_size() # if there is no output directory
Access Error
>>> file_size() # if there is a valid output directory
Used SPACE --> 78.1 KB
- find_global_ip()
- Find the global IP for using in API
:return: return the IP as string
- font_creator(css_file, font_section)
- Ask and Select font.
:param css_file: the file that font css will be added to.
:param font_section: the font section of css file
:type css_file:_io.TextIOWrapper
:type font_section:str
:return font_section: the font section of css after edit as string
- generation_time(time_1=None)
- Calculate the generation time
:param time_1: time that passed but not counted in generation time
:type time_1:float
:return :the amount of time that passed as float
- get_color_code()
- Ask for selecting color of text and background
:return list: background and text color
>>> get_color_code()
0 - White
1 - Black
2 - Purple
3 - Yellow
4 - Orange
5 - Green
6 - Blue
Please enter your background color : 1
Please enter your text color : 2
[1, 2]
- html_end(name)
- Create End Of The Html and close file
:param name: The name of html file.
:type name:str
- html_init(name)
- Create Initial Form Of each Html Page Like Title And HTML And Body Tag.
:param name: the name of html file.
:type name:str
- icon_creator()
- Find .ico file and use it as favicon of website.
:return:None
- internet(host='8.8.8.8', port=53, timeout=3)
- Check Internet Connections.
:param host: the host that check connection to
:param port: port that check connection with
:param timeout: times that check the connnection
:type host:str
:type port:int
:type timeout:int
:return bool: True if Connection is Stable
>>> internet() # if there is stable internet connection
True
>>> internet() # if there is no stable internet connection
False
- is_sample_downloaded()
- Check the sample site material is downloaded of not
:return : index of materials that downloaded as list
- list_randomize(input_list)
- :param input_list: raw_input list
:type input_list:list
:return: randomized list
>>> random.seed(1)
>>> list_randomize([1,2,3,5,6])
[2, 1, 5, 3, 6]
- logger(status=False, perf_time=None)
- Create the build log of the app
:param status: show status of app.
:param perf_time : show the time passed for generate files
:type status:bool
:type perf_time:float
- menu_maker()
- Top Menu Maker In each html page
:return:site menu as string
- menu_writer()
- Write menu_maker output in html and close file after
:return:None
- name_standard(name)
- return the Standard VERSION of the input word
:param name: the name that should be standard
:type name:str
:return name: the standard form of word as string
>>> name_standard('test')
'Test'
>>> name_standard('TesT')
'Test'
- page_name_update()
- This Function Update Page Names
:return: None
- preview()
- Preview website in browser
:return:None
- print_adv(file, close=True)
- Print the advertisement (qpage footer)
:param file : The file that should adv to it.
:param close : Close file after add
:type file:_io.TextIOWrapper
:type close:bool
:return: None
- print_download(file, name, link, center=False, close=False)
- Create Download Link in page
:param file: The file that contain html of page.
:param name: The name of the link
:param link: The place that name is Linked
:param center: put the text in center
:param close : close file after done editing
:type center: bool
:type close : bool
:type link:str
:type name:str
:type file:_io.TextIOWrapper
:return:None
- print_image(file, image_format='jpg', close=False)
- Write Image Part OF The Page.
:param file: The file that images will be added.
:param close : flag of closing file after editing
:param image_format: the format of image
:type close : bool
:type image_format:str
:type file:_io.TextIOWrapper
:return:None
- print_line(number, char='-')
- Print a Line
:param number: the amount char that in lien
:param char : the char that used to draw line
:type number :int
:type char : str
>>> print_line(4)
----
>>> print_line(5,"%")
%%%%%
- print_logo(external=False)
- print qpage logo by sequential characters
:param external: flag for choosing internal or external logo
:type external:bool
:return: None
>>> print_logo()
____ ___
/ __ \ / _ \___ ____ ____
/ /_/ / / ___/ _ `/ _ `/ -_)
\___\_\/_/ \_,_/\_, /\__/
/___/
- print_meta()
- Add meta to html files
:return static_meta: The meta that created
- print_text(text_file, file, center=False, close=False)
- Write the text part of each page
:param text_file: Text that should be written.
:param file : The file that text will be written inside.
:param center: flag of putting text in center
:param close : flag of closing file after editing
:type close : bool
:type center: bool
:type file:_io.TextIOWrapper
:type text_file:str
:return:None
- print_warning()
- Print warnings!
:return:None
- random_badge_color()
- return a random color for badge
:return: badge color as string
>>> random.seed(1)
>>> random_badge_color()
'yellowgreen'
- read_lorem(char=100, external=False, randomize=True)
- find and read lorem
:param char: the amount of char that needed to print
:param external: flag for using external of internal resource for lorem_ipsum
:param randomize: flag for using randomization
:type char:int
:type external:bool
:type randomize:bool
:return : the lorem string
>>> read_lorem(5)
'Lorem ipsum dolor sit amet,'
- reduce(...)
- reduce(function, sequence[, initial]) -> value
Apply a function of two arguments cumulatively to the items of a sequence,
from left to right, so as to reduce the sequence to a single value.
For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
((((1+2)+3)+4)+5). If initial is present, it is placed before the items
of the sequence in the calculation, and serves as a default when the
sequence is empty.
- robot_maker()
- Create Robots.txt for pages
:return:None
- sample_browser(sample_number=1)
- sample_site_download(item_list)
- Download sample material for make a fake site
:param item_list: Download items form item_list
:type item_list:list
- server()
- Get Server response.
:return:None
>>> server()
Installed Saved!
- show_items(enum_list)
- show item of enum_list
:param enum_list the list that should be shown
:type enum_list : list
- system_details()
- Show detail of system that code is runnig on
:return: system details as string (node , processor , platform)
>>> system_details()
'DESKTOP-B16C9BR , Intel64 Family 6 Model 94 Stepping 3, GenuineIntel , Windows-10-10.0.10240-SP0'
- version_control()
- Check and update version status
:return:None
- wait_func(iteration=2)
- Wait for-in range Iteration.
:param iteration: the amount of wait.
:type iteration:int
:return:None
>>> wait_func(4)
.
.
.
.
>>> wait_func()
.
.
|