예제 #1
0
def Ex4():
    string = "Azaz sis somarolinto go go go trenyzi12 keks koks kaks 74rus 123 321 pas123sajiri"
    print(StringFormatter.del_worlds(string, 5))
    print(StringFormatter.replace(string))
    print(StringFormatter.set_spaces(string))
    print(StringFormatter.sort_size(string))
    print(StringFormatter.sort(string))
예제 #2
0
파일: MF5.py 프로젝트: G-Mell/L3
    def on_format_click(self, event):
        result = self.entry_text.Value

        if self.sort_checkbox.IsChecked():
            if self.radio_by_size.GetValue():
                result = StringFormatter.SortSize(result)
            else:
                result = StringFormatter.SortLex(result)

        if self.clean_checkbox.IsChecked():
            result = StringFormatter.DelWords(result,
                                              int(self.size_spin.Value))

        if self.replace_checkbox.IsChecked():
            result = StringFormatter.ReplaceNum(result)

        if self.insert_spaces_checkbox.IsChecked():
            result = StringFormatter.CreateSpace(result)

        self.result_text.Value = result
예제 #3
0
    def on_format_click(self, event):
        result = self.entry_text.Value

        if self.sort_checkbox.IsChecked():
            if self.radio_by_size.GetValue():
                result = StringFormatter.sort_size(result)
            else:
                result = StringFormatter.sort(result)

        if self.clean_checkbox.IsChecked():
            result = StringFormatter.del_worlds(result,
                                                int(self.size_spin.Value))

        if self.replace_checkbox.IsChecked():
            result = StringFormatter.replace(result)

        if self.insert_spaces_checkbox.IsChecked():
            result = StringFormatter.set_spaces(result)

        self.result_text.Value = result
 def get_formatted_urls(self):
     return StringFormatter.get_recursively_formatted_string(
         self.template_url, self.years)
 def get_formatted_filenames(self):
     return StringFormatter.get_recursively_formatted_string(
         self.template_filename, self.years)
예제 #6
0
파일: main4.py 프로젝트: cherryVsV/3-laba
from StringFormatter import StringFormatter
string = "tttt 5k7 kkllp;l,lp,m aaaa a p rfjri "
print(StringFormatter.DelWords(string, 3))
print(StringFormatter.ReplaceNum(string))
print(StringFormatter.CreateSpace(string))
print(StringFormatter.SortSize(string))
print(StringFormatter.SortLex(string))
예제 #7
0
파일: task4.py 프로젝트: Klym/python_labs
    def formatString(self):
        formatter = StringFormatter(unicode(self.ui.lineEdit_2.text()))
        if self.ui.checkBox.isChecked():
            formatter.delSmallWords(int(self.ui.spinBox.text()))
        if self.ui.checkBox_4.isChecked():
            if self.ui.radioButton.isChecked():
                formatter.sortWordsBySize()
            else:
                formatter.sortWordsLexicographically()
        if self.ui.checkBox_2.isChecked():
            formatter.replaceDigits()
        if self.ui.checkBox_3.isChecked():
            formatter.insertSpaces()

        self.ui.lineEdit.setText(formatter.getString())
예제 #8
0
 def get_formatted_filenames(self):
     formatted_filenames = StringFormatter.get_recursively_formatted_string(self.template_filename, self.stats_url_values.keys())
     return StringFormatter.get_recursively_formatted_strings(formatted_filenames, self.years)
예제 #9
0
 def get_formatted_urls(self):
     formatted_urls = StringFormatter.get_recursively_formatted_string(self.template_url, self.stats_url_values.values())
     return StringFormatter.get_recursively_formatted_strings(formatted_urls, self.years)