Compare commits
35 Commits
9e62197eba
...
lib-devel
| Author | SHA1 | Date | |
|---|---|---|---|
| cf173843d2 | |||
| d8808ddf5b | |||
| b5ee32e924 | |||
| b69463a303 | |||
| 82710a73a3 | |||
| 275101eed3 | |||
| 3826c7d2d1 | |||
| 377251b59f | |||
| 428946e39a | |||
| c5662c8397 | |||
| e3307d8db5 | |||
| 01dd92e4da | |||
| 8628c3dbfb | |||
| d69a3d0628 | |||
| b6000c49fd | |||
| 851dcf103d | |||
| 4118ed82c3 | |||
| 435bb144ab | |||
| ccc06bc5f1 | |||
| ef91f8d26a | |||
| fe75d99736 | |||
| a4e550797c | |||
| 6e83ce559d | |||
| 04a32c7bd1 | |||
| e6fb04a9e7 | |||
| b53fb27a60 | |||
| 0bbb1947ee | |||
| 7ca177f29a | |||
| 1e8867182f | |||
| a798f29b73 | |||
| 59c41cc3ba | |||
| 18566dda2c | |||
| 59f11a2f8b | |||
| dfcbef7ae4 | |||
| 0502d77c14 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
/.DS_Store
|
/.DS_Store
|
||||||
/.project
|
/.project
|
||||||
/.pydevproject
|
/.pydevproject
|
||||||
|
/org.eclipse.core.resources.prefs
|
||||||
bananaSPLIT/build
|
bananaSPLIT/build
|
||||||
bananaSPLIT.exe.spec
|
/TestFiles/
|
||||||
|
|||||||
1
.settings/.gitignore
vendored
Normal file
1
.settings/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/org.eclipse.core.resources.prefs
|
||||||
13811
TestFiles/GUARDIAN 1993.txt
Normal file
13811
TestFiles/GUARDIAN 1993.txt
Normal file
File diff suppressed because it is too large
Load Diff
22792
TestFiles/NYT 1990.txt
Normal file
22792
TestFiles/NYT 1990.txt
Normal file
File diff suppressed because it is too large
Load Diff
23149
TestFiles/NYT 1994.txt
Normal file
23149
TestFiles/NYT 1994.txt
Normal file
File diff suppressed because it is too large
Load Diff
30024
TestFiles/NYT 1997.txt
Normal file
30024
TestFiles/NYT 1997.txt
Normal file
File diff suppressed because it is too large
Load Diff
1
TestFiles/README
Normal file
1
TestFiles/README
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Qui si mettono i file di test per la versione GUI di bananaSPLIT
|
||||||
3
bananaSPLIT/.gitignore
vendored
3
bananaSPLIT/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
*.py[ocd]
|
*.py[ocd]
|
||||||
|
/bananaSPLIT.exe.spec
|
||||||
|
|||||||
121
bananaSPLIT/UserInterface/SelezioneOutput.ui
Normal file
121
bananaSPLIT/UserInterface/SelezioneOutput.ui
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Dialog</class>
|
||||||
|
<widget class="QDialog" name="Dialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>509</width>
|
||||||
|
<height>303</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>509</width>
|
||||||
|
<height>303</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>251</width>
|
||||||
|
<height>141</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rad_MainbodyEFile">
|
||||||
|
<property name="text">
|
||||||
|
<string>Main body + File singoli</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rad_File">
|
||||||
|
<property name="text">
|
||||||
|
<string>File singoli</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rad_Mainbody">
|
||||||
|
<property name="text">
|
||||||
|
<string>Main body</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="lbl_indicazioni">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>401</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Seleziona i file che il programma ti deve fare*chiaramente da cambiare le parole</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>330</x>
|
||||||
|
<y>230</y>
|
||||||
|
<width>160</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_Indietro">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Indietro</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_Avanti">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Avanti</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Form implementation generated from reading ui file 'mainwindow.ui'
|
|
||||||
#
|
|
||||||
# Created by: PyQt5 UI code generator 5.12.1
|
|
||||||
#
|
|
||||||
# WARNING! All changes made in this file will be lost!
|
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
|
||||||
|
|
||||||
|
|
||||||
class Ui_win_main(object):
|
|
||||||
def setupUi(self, win_main):
|
|
||||||
win_main.setObjectName("win_main")
|
|
||||||
win_main.setEnabled(True)
|
|
||||||
win_main.resize(653, 517)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(win_main.sizePolicy().hasHeightForWidth())
|
|
||||||
win_main.setSizePolicy(sizePolicy)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setFamily("MS Shell Dlg 2")
|
|
||||||
font.setPointSize(10)
|
|
||||||
win_main.setFont(font)
|
|
||||||
win_main.setFocusPolicy(QtCore.Qt.NoFocus)
|
|
||||||
self.centralwidget = QtWidgets.QWidget(win_main)
|
|
||||||
self.centralwidget.setObjectName("centralwidget")
|
|
||||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.centralwidget)
|
|
||||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
|
||||||
self.wgt_main = QtWidgets.QWidget(self.centralwidget)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.wgt_main.sizePolicy().hasHeightForWidth())
|
|
||||||
self.wgt_main.setSizePolicy(sizePolicy)
|
|
||||||
self.wgt_main.setObjectName("wgt_main")
|
|
||||||
self.gridLayout = QtWidgets.QGridLayout(self.wgt_main)
|
|
||||||
self.gridLayout.setObjectName("gridLayout")
|
|
||||||
spacerItem = QtWidgets.QSpacerItem(404, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
||||||
self.gridLayout.addItem(spacerItem, 0, 2, 1, 1)
|
|
||||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
|
||||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
|
||||||
self.btn_cartellasorg = QtWidgets.QPushButton(self.wgt_main)
|
|
||||||
self.btn_cartellasorg.setObjectName("btn_cartellasorg")
|
|
||||||
self.verticalLayout_2.addWidget(self.btn_cartellasorg)
|
|
||||||
self.btn_cartelladest = QtWidgets.QPushButton(self.wgt_main)
|
|
||||||
self.btn_cartelladest.setObjectName("btn_cartelladest")
|
|
||||||
self.verticalLayout_2.addWidget(self.btn_cartelladest)
|
|
||||||
self.gridLayout.addLayout(self.verticalLayout_2, 0, 1, 1, 1)
|
|
||||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
|
||||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
|
||||||
self.chk_predefinita = QtWidgets.QCheckBox(self.wgt_main)
|
|
||||||
self.chk_predefinita.setObjectName("chk_predefinita")
|
|
||||||
self.horizontalLayout_2.addWidget(self.chk_predefinita)
|
|
||||||
self.btn_avanti = QtWidgets.QPushButton(self.wgt_main)
|
|
||||||
self.btn_avanti.setMinimumSize(QtCore.QSize(79, 0))
|
|
||||||
self.btn_avanti.setMaximumSize(QtCore.QSize(79, 16777215))
|
|
||||||
self.btn_avanti.setObjectName("btn_avanti")
|
|
||||||
self.horizontalLayout_2.addWidget(self.btn_avanti)
|
|
||||||
self.gridLayout.addLayout(self.horizontalLayout_2, 1, 0, 1, 3)
|
|
||||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
|
||||||
self.verticalLayout.setObjectName("verticalLayout")
|
|
||||||
self.lbl_cartellasorg = QtWidgets.QLabel(self.wgt_main)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.lbl_cartellasorg.setFont(font)
|
|
||||||
self.lbl_cartellasorg.setObjectName("lbl_cartellasorg")
|
|
||||||
self.verticalLayout.addWidget(self.lbl_cartellasorg)
|
|
||||||
self.lbl_cartelladest = QtWidgets.QLabel(self.wgt_main)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setPointSize(10)
|
|
||||||
self.lbl_cartelladest.setFont(font)
|
|
||||||
self.lbl_cartelladest.setObjectName("lbl_cartelladest")
|
|
||||||
self.verticalLayout.addWidget(self.lbl_cartelladest)
|
|
||||||
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
|
|
||||||
self.btn_opzioni = QtWidgets.QPushButton(self.wgt_main)
|
|
||||||
self.btn_opzioni.setObjectName("btn_opzioni")
|
|
||||||
self.gridLayout.addWidget(self.btn_opzioni, 2, 2, 1, 1)
|
|
||||||
self.verticalLayout_3.addWidget(self.wgt_main)
|
|
||||||
self.line_2 = QtWidgets.QFrame(self.centralwidget)
|
|
||||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
|
||||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
||||||
self.line_2.setObjectName("line_2")
|
|
||||||
self.verticalLayout_3.addWidget(self.line_2)
|
|
||||||
self.wgt_sub = QtWidgets.QWidget(self.centralwidget)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.wgt_sub.sizePolicy().hasHeightForWidth())
|
|
||||||
self.wgt_sub.setSizePolicy(sizePolicy)
|
|
||||||
self.wgt_sub.setMinimumSize(QtCore.QSize(0, 75))
|
|
||||||
self.wgt_sub.setMaximumSize(QtCore.QSize(16777215, 500))
|
|
||||||
self.wgt_sub.setObjectName("wgt_sub")
|
|
||||||
self.verticalLayout_3.addWidget(self.wgt_sub)
|
|
||||||
win_main.setCentralWidget(self.centralwidget)
|
|
||||||
self.menubar = QtWidgets.QMenuBar(win_main)
|
|
||||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 653, 22))
|
|
||||||
self.menubar.setObjectName("menubar")
|
|
||||||
self.bar_file = QtWidgets.QMenu(self.menubar)
|
|
||||||
self.bar_file.setObjectName("bar_file")
|
|
||||||
self.bar_settings = QtWidgets.QMenu(self.menubar)
|
|
||||||
self.bar_settings.setGeometry(QtCore.QRect(375, 101, 135, 50))
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.bar_settings.sizePolicy().hasHeightForWidth())
|
|
||||||
self.bar_settings.setSizePolicy(sizePolicy)
|
|
||||||
self.bar_settings.setAcceptDrops(False)
|
|
||||||
self.bar_settings.setObjectName("bar_settings")
|
|
||||||
win_main.setMenuBar(self.menubar)
|
|
||||||
self.statusbar = QtWidgets.QStatusBar(win_main)
|
|
||||||
self.statusbar.setObjectName("statusbar")
|
|
||||||
win_main.setStatusBar(self.statusbar)
|
|
||||||
self.toolBar = QtWidgets.QToolBar(win_main)
|
|
||||||
self.toolBar.setObjectName("toolBar")
|
|
||||||
win_main.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
|
||||||
self.menubar.addAction(self.bar_file.menuAction())
|
|
||||||
self.menubar.addAction(self.bar_settings.menuAction())
|
|
||||||
|
|
||||||
self.retranslateUi(win_main)
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(win_main)
|
|
||||||
|
|
||||||
def retranslateUi(self, win_main):
|
|
||||||
_translate = QtCore.QCoreApplication.translate
|
|
||||||
win_main.setWindowTitle(_translate("win_main", "bananaSPLIT"))
|
|
||||||
self.btn_cartellasorg.setText(_translate("win_main", "..."))
|
|
||||||
self.btn_cartelladest.setText(_translate("win_main", "..."))
|
|
||||||
self.chk_predefinita.setText(_translate("win_main", "Rendi predefinite le cartelle"))
|
|
||||||
self.btn_avanti.setText(_translate("win_main", "Avanti"))
|
|
||||||
self.lbl_cartellasorg.setText(_translate("win_main", "Cartella sorgente"))
|
|
||||||
self.lbl_cartelladest.setText(_translate("win_main", "Cartella destinazione"))
|
|
||||||
self.btn_opzioni.setText(_translate("win_main", "Opzioni"))
|
|
||||||
self.bar_file.setTitle(_translate("win_main", "File"))
|
|
||||||
self.bar_settings.setTitle(_translate("win_main", "Settings"))
|
|
||||||
self.toolBar.setWindowTitle(_translate("win_main", "toolBar"))
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,168 +2,112 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>win_main</class>
|
<class>win_main</class>
|
||||||
<widget class="QMainWindow" name="win_main">
|
<widget class="QMainWindow" name="win_main">
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>653</width>
|
<width>519</width>
|
||||||
<height>517</height>
|
<height>391</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>MS Shell Dlg 2</family>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>bananaSPLIT</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
<item>
|
<property name="geometry">
|
||||||
<widget class="QWidget" name="wgt_main" native="true">
|
<rect>
|
||||||
<property name="sizePolicy">
|
<x>20</x>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
<y>110</y>
|
||||||
<horstretch>0</horstretch>
|
<width>131</width>
|
||||||
<verstretch>0</verstretch>
|
<height>71</height>
|
||||||
</sizepolicy>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item row="0" column="2">
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<widget class="QLabel" name="lbl_cartellasorg">
|
||||||
<property name="orientation">
|
<property name="font">
|
||||||
<enum>Qt::Horizontal</enum>
|
<font>
|
||||||
</property>
|
<pointsize>10</pointsize>
|
||||||
<property name="sizeHint" stdset="0">
|
</font>
|
||||||
<size>
|
|
||||||
<width>404</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btn_cartellasorg">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btn_cartelladest">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" colspan="3">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="chk_predefinita">
|
|
||||||
<property name="text">
|
|
||||||
<string>Rendi predefinite le cartelle</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_cartellasorg">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cartella sorgente</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_cartelladest">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cartella destinazione</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="wgt_sub" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>75</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>500</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<widget class="QPushButton" name="btn_opzioni">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>440</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>81</width>
|
|
||||||
<height>24</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Opzioni</string>
|
<string>Cartella sorgente</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QPushButton" name="btn_avanti">
|
</item>
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QLabel" name="lbl_cartelladest">
|
||||||
<x>540</x>
|
<property name="font">
|
||||||
<y>40</y>
|
<font>
|
||||||
<width>79</width>
|
<pointsize>10</pointsize>
|
||||||
<height>24</height>
|
</font>
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cartella destinazione</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>150</x>
|
||||||
|
<y>110</y>
|
||||||
|
<width>34</width>
|
||||||
|
<height>71</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_cartellasorg">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_cartelladest">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>491</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>180</y>
|
||||||
|
<width>421</width>
|
||||||
|
<height>80</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chk_predefinita">
|
||||||
|
<property name="text">
|
||||||
|
<string>Rendi predefinite le cartelle</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_avanti">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>79</width>
|
<width>79</width>
|
||||||
@@ -180,61 +124,40 @@
|
|||||||
<string>Avanti</string>
|
<string>Avanti</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
</layout>
|
||||||
</layout>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="btn_opzioni">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>420</x>
|
||||||
|
<y>300</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Opzioni</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>653</width>
|
<width>519</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="bar_file">
|
<widget class="QMenu" name="menuBananaSplit">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>File</string>
|
<string>BananaSplit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="bar_settings">
|
<addaction name="menuBananaSplit"/>
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>375</x>
|
|
||||||
<y>101</y>
|
|
||||||
<width>135</width>
|
|
||||||
<height>50</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="acceptDrops">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Settings</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<addaction name="bar_file"/>
|
|
||||||
<addaction name="bar_settings"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
<widget class="QToolBar" name="toolBar">
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>toolBar</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="toolBarArea">
|
|
||||||
<enum>TopToolBarArea</enum>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="toolBarBreak">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -1,180 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Form</class>
|
|
||||||
<widget class="QWidget" name="Form">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>404</width>
|
|
||||||
<height>204</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="lbl_indicazioni">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>9</x>
|
|
||||||
<y>9</y>
|
|
||||||
<width>125</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Seleziona il tipo di file</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>30</y>
|
|
||||||
<width>382</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>50</y>
|
|
||||||
<width>145</width>
|
|
||||||
<height>74</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetMaximumSize</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rad_MainbodyEFile">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Bodyfile + File singoli</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rad_Mainbody">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Bodyfile</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rad_File">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>File singoli</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>150</y>
|
|
||||||
<width>381</width>
|
|
||||||
<height>26</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btn_Indietro">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>75</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>75</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Indietro</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btn_Avanti">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>75</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>75</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Avanti</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -1,371 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>MainWindow</class>
|
|
||||||
<widget class="QMainWindow" name="MainWindow">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>451</width>
|
|
||||||
<height>413</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>MainWindow</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="centralwidget">
|
|
||||||
<widget class="QLabel" name="lbl_impotit">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>261</width>
|
|
||||||
<height>31</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Impostazioni nome file</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>431</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="chc_data">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>40</y>
|
|
||||||
<width>70</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Data</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="chc_titolo">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>150</y>
|
|
||||||
<width>131</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Titolo articolo</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="verticalLayoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>40</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>164</width>
|
|
||||||
<height>80</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rad_datajpn">
|
|
||||||
<property name="text">
|
|
||||||
<string>YYYY MM DD, es. 2000 12 31</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rad_dataita">
|
|
||||||
<property name="text">
|
|
||||||
<string>DD MM YYYY, es. 31 12 2000</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="rad_datausa">
|
|
||||||
<property name="text">
|
|
||||||
<string>MM DD YYYY, es. 12 31 2000</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>40</x>
|
|
||||||
<y>170</y>
|
|
||||||
<width>141</width>
|
|
||||||
<height>31</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="lbl_ncarat">
|
|
||||||
<property name="text">
|
|
||||||
<string>Numero di caratteri</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spn_ncarat">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCheckBox" name="chc_docnum">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>210</y>
|
|
||||||
<width>141</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Numero documento</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="Line" name="line_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>330</y>
|
|
||||||
<width>431</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="horizontalLayoutWidget_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>350</y>
|
|
||||||
<width>431</width>
|
|
||||||
<height>41</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Indietro</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btn_avanzate">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Avanzate</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="btn_avanti">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Avanti</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="Line" name="line_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>230</y>
|
|
||||||
<width>431</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>20</x>
|
|
||||||
<y>250</y>
|
|
||||||
<width>141</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Separatore</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QRadioButton" name="radioButton_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>270</y>
|
|
||||||
<width>76</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Spazio</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QRadioButton" name="radioButton_4">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>290</y>
|
|
||||||
<width>76</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>,</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QRadioButton" name="radioButton">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>120</x>
|
|
||||||
<y>270</y>
|
|
||||||
<width>157</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>8</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>-</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QRadioButton" name="radioButton_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>310</y>
|
|
||||||
<width>76</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>\</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QRadioButton" name="radioButton_5">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>120</x>
|
|
||||||
<y>290</y>
|
|
||||||
<width>158</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>_</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QRadioButton" name="radioButton_6">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>120</x>
|
|
||||||
<y>310</y>
|
|
||||||
<width>51</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Altro:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>170</x>
|
|
||||||
<y>310</y>
|
|
||||||
<width>71</width>
|
|
||||||
<height>20</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
'''
|
|
||||||
Created on 2 nov 2019
|
|
||||||
|
|
||||||
@author: Emanuele Trabattoni
|
|
||||||
'''
|
|
||||||
import sys
|
|
||||||
import PyQt5.QtWidgets
|
|
||||||
from bananaSPLIT.UserInterface.guis import Ui_win_main
|
|
||||||
|
|
||||||
class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
|
||||||
def __init__(self):
|
|
||||||
PyQt5.QtWidgets.QMainWindow.__init__(self)
|
|
||||||
self.ui = Ui_win_main()
|
|
||||||
self.ui.setupUi(self)
|
|
||||||
pass
|
|
||||||
|
|
||||||
#############################################################
|
|
||||||
####################### MAIN ################################
|
|
||||||
#############################################################
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
app = PyQt5.QtWidgets.QApplication(sys.argv)
|
|
||||||
window = bananaMain()
|
|
||||||
window.resize(window.sizeHint().width(), window.size().height())
|
|
||||||
window.show()
|
|
||||||
rv = app.exec()
|
|
||||||
print("ExitCode: {}".format(rv))
|
|
||||||
sys.exit(rv)
|
|
||||||
pass
|
|
||||||
0
bananaSPLIT/libbananasplit/__init__.py
Normal file
0
bananaSPLIT/libbananasplit/__init__.py
Normal file
83
bananaSPLIT/libbananasplit/libconfload.py
Normal file
83
bananaSPLIT/libbananasplit/libconfload.py
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
'''
|
||||||
|
Created on 2 nov 2019
|
||||||
|
|
||||||
|
@author: Emanuele Trabattoni
|
||||||
|
'''
|
||||||
|
import json,os,glob,copy
|
||||||
|
|
||||||
|
class bananaCONF(object):
|
||||||
|
'''
|
||||||
|
Carica e Salva file di configurazione per bananaSPLITTER
|
||||||
|
'''
|
||||||
|
def __init__(self, workdir=None, logger=None):
|
||||||
|
self.log = logger
|
||||||
|
self.fileList = None
|
||||||
|
self.workdir = None
|
||||||
|
self.inUse = None
|
||||||
|
self.settingsList = dict()
|
||||||
|
if workdir is not None:
|
||||||
|
self.workdir = workdir
|
||||||
|
os.chdir(workdir)
|
||||||
|
self.log.debug("Cerco le configurazioni in: [{}]".format(os.getcwd()))
|
||||||
|
else:
|
||||||
|
self.log.error("Non mi e' stata fornita una directory per i file di configurazione")
|
||||||
|
pass
|
||||||
|
|
||||||
|
def open(self):
|
||||||
|
self.log.info("Carico i file di configurazione")
|
||||||
|
self.fileList = glob.glob(r"*.json")
|
||||||
|
if len(self.fileList) > 0:
|
||||||
|
for f in self.fileList:
|
||||||
|
try:
|
||||||
|
fp = open(f)
|
||||||
|
tf = json.load(fp)
|
||||||
|
fName = f.split("\\")[-1]
|
||||||
|
self.settingsList[fName] = copy.deepcopy(tf)
|
||||||
|
self.log.info("Caricato correttamente: {}".format(fName))
|
||||||
|
fp.close()
|
||||||
|
except json.JSONDecodeError as e:
|
||||||
|
self.log.error("Impossibile leggere la configurazione:{}\n \
|
||||||
|
Controlla il file a riga: {} e colonna:{}" .format(e.doc, e.lineno, e.colno))
|
||||||
|
except IOError as ee:
|
||||||
|
self.log.error("Impossibile aprire il file: {}".format(ee))
|
||||||
|
except Exception as eee:
|
||||||
|
self.log.critical("Eccezione inaspettata: {}".format(eee))
|
||||||
|
else:
|
||||||
|
self.log.error("Non ho trovato alcun file di configurazione!")
|
||||||
|
pass
|
||||||
|
|
||||||
|
def reload(self):
|
||||||
|
self.settingsList = None
|
||||||
|
self.fileList = None
|
||||||
|
self.inUse = None
|
||||||
|
self.open()
|
||||||
|
pass
|
||||||
|
|
||||||
|
def use(self, toUse):
|
||||||
|
self.inUse = toUse
|
||||||
|
pass
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
self.log.info("Salvo la configurazione: {}".format(self.inUse))
|
||||||
|
try:
|
||||||
|
os.chdir(self.workdir)
|
||||||
|
f=open(self.inUse)
|
||||||
|
json.dump(self.settingsList[self.inUse], f)
|
||||||
|
f.close()
|
||||||
|
except IOError as e:
|
||||||
|
self.log.error("Impossibile salvare il file: {} - [{}]".format(self.inUse,e))
|
||||||
|
pass
|
||||||
|
|
||||||
|
def getFiles(self):
|
||||||
|
return self.fileList
|
||||||
|
|
||||||
|
def getParams(self, k):
|
||||||
|
return self.settingsList[self.inUse][k]
|
||||||
|
pass
|
||||||
|
|
||||||
|
def setParams(self, k, v):
|
||||||
|
self.settingsList[self.inUse][k]=dict(v)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
85
bananaSPLIT/libbananasplit/libfancylogger.py
Normal file
85
bananaSPLIT/libbananasplit/libfancylogger.py
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
'''
|
||||||
|
Created on 2 nov 2019
|
||||||
|
|
||||||
|
@author: Emanuele Trabattoni
|
||||||
|
'''
|
||||||
|
import sys, os
|
||||||
|
import json
|
||||||
|
import logging
|
||||||
|
import colorama
|
||||||
|
|
||||||
|
class fancyLogger(object):
|
||||||
|
'''
|
||||||
|
Colorizza il logger di python, per un' esperienza stile willy wonka
|
||||||
|
'''
|
||||||
|
def __init__(self, name="Logger", consoleLog=True, fileLog=True):
|
||||||
|
settings = json.load(open(os.getcwd()+r"\libbananasplit\testEN.json"))["logger"]
|
||||||
|
colorama.init(convert=True)
|
||||||
|
self.LRED = colorama.Fore.LIGHTRED_EX
|
||||||
|
self.RED = colorama.Fore.RED
|
||||||
|
self.LYELLOW = colorama.Fore.LIGHTYELLOW_EX
|
||||||
|
self.YELLOW = colorama.Fore.YELLOW
|
||||||
|
self.LBLUE = colorama.Fore.LIGHTBLUE_EX
|
||||||
|
self.BLUE = colorama.Fore.BLUE
|
||||||
|
self.LGREEN = colorama.Fore.LIGHTGREEN_EX
|
||||||
|
self.LGREEN = colorama.Fore.GREEN
|
||||||
|
self.WHITE = colorama.Fore.LIGHTWHITE_EX
|
||||||
|
self.RST = colorama.Style.RESET_ALL
|
||||||
|
|
||||||
|
# Setup Logger
|
||||||
|
self.LOGGER = logging.getLogger(name)
|
||||||
|
self.LOGGER.setLevel(logging.DEBUG)
|
||||||
|
self.LOGGER.propagate = False
|
||||||
|
FORMATTER = logging.Formatter((settings["logFormat"]), (settings["logTimeFormat"]))
|
||||||
|
if fileLog:
|
||||||
|
# File Logging
|
||||||
|
fh = logging.FileHandler((settings["logFile"]))
|
||||||
|
fh.setLevel(logging.DEBUG)
|
||||||
|
fh.setFormatter(FORMATTER)
|
||||||
|
self.LOGGER.addHandler(fh)
|
||||||
|
if consoleLog:
|
||||||
|
# Console Logging
|
||||||
|
cl= logging.StreamHandler(sys.stdout)
|
||||||
|
cl.setLevel(logging.DEBUG)
|
||||||
|
cl.setFormatter(FORMATTER)
|
||||||
|
self.LOGGER.addHandler(cl)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def debug(self, msg="Undefined Debug"):
|
||||||
|
print(self.LBLUE, end='')
|
||||||
|
self.LOGGER.debug(msg)
|
||||||
|
print(self.RST, end='')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def info(self, msg="Undefined Info"):
|
||||||
|
print(self.LGREEN, end='')
|
||||||
|
self.LOGGER.info(msg)
|
||||||
|
print(self.RST, end='')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def warn(self, msg="Undefined Warning"):
|
||||||
|
print(self.LYELLOW, end='')
|
||||||
|
self.LOGGER.warning(msg)
|
||||||
|
print(self.RST, end='')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def error(self, msg="Undefined Error"):
|
||||||
|
print(self.LRED, end='')
|
||||||
|
self.LOGGER.error(msg)
|
||||||
|
print(self.RST, end='')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def critical(self, msg="Undefined Critical"):
|
||||||
|
print(self.RED, end='')
|
||||||
|
self.LOGGER.critical(msg)
|
||||||
|
print(self.RST, end='')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def testColors(self):
|
||||||
|
self.debug("Test Debug")
|
||||||
|
self.info("Test Info")
|
||||||
|
self.warn("Test Warning")
|
||||||
|
self.error("Test Error")
|
||||||
|
self.critical("Test Critical")
|
||||||
|
pass
|
||||||
|
|
||||||
276
bananaSPLIT/libbananasplit/libsplit.py
Normal file
276
bananaSPLIT/libbananasplit/libsplit.py
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
'''
|
||||||
|
Created on 2 nov 2019
|
||||||
|
|
||||||
|
@author: Emanuele Trabattoni
|
||||||
|
'''
|
||||||
|
from slugify.slugify import slugify
|
||||||
|
import time, parse, re, copy, os, threading
|
||||||
|
|
||||||
|
class bananaSPLITTER(threading.Thread):
|
||||||
|
def __init__(self, fileParams=None, logger=None):
|
||||||
|
threading.Thread.__init__(self)
|
||||||
|
self.fileParams = fileParams
|
||||||
|
self.log = logger
|
||||||
|
self.rawFile = None
|
||||||
|
self.status = "first"
|
||||||
|
self.fileList = list()
|
||||||
|
self.bodyCounter=0
|
||||||
|
self.duplicateNumber=0
|
||||||
|
if fileParams is not None:
|
||||||
|
self.log.info("Sto operando sul file: {}..".format(self.fileParams['name']))
|
||||||
|
self.paths = self.fileParams['paths']
|
||||||
|
self.docStruct = self.fileParams['docStruct']
|
||||||
|
self.settings = self.fileParams['settings']
|
||||||
|
self.fileName = self.fileParams['name']
|
||||||
|
self.outPath = self.paths['OUTworkPath']+slugify(self.fileName)
|
||||||
|
self.beginTime = time.time()
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.log.critical("Non e' stato fornito il nome di alcun file da splittare!")
|
||||||
|
pass
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.log.info("Nuovo SPLITTER su file: {}".format(self.fileName))
|
||||||
|
try:
|
||||||
|
self.openFile()
|
||||||
|
self.remEmptyLines()
|
||||||
|
self.splitFile()
|
||||||
|
|
||||||
|
if self.settings['removeDuplicates']:
|
||||||
|
self.log.info("Controllo se ci sono dei duplicati..")
|
||||||
|
self.removeDuplicates()
|
||||||
|
else:
|
||||||
|
for idx, ff in enumerate(self.fileList):
|
||||||
|
ff['duplicate']=False
|
||||||
|
self.fileList[idx]=ff
|
||||||
|
self.log.warn('Salto il controllo dei duplicati..')
|
||||||
|
# se il parse e la rimozione dei duplicati e' andata bene
|
||||||
|
# preparo e inizio il salvataggio
|
||||||
|
if os.path.exists(self.outPath):
|
||||||
|
if self.settings['removeOldFiles']:
|
||||||
|
os.chdir(self.outPath)
|
||||||
|
for f in os.listdir(self.outPath):
|
||||||
|
os.remove(f)
|
||||||
|
else:
|
||||||
|
raise FileExistsError("Non posso sovrascrivere i vecchi file, eliminali manualmente!")
|
||||||
|
else:
|
||||||
|
os.mkdir(self.outPath)
|
||||||
|
os.chdir(self.outPath)
|
||||||
|
if self.settings['saveSeparateFiles']:
|
||||||
|
self.saveSeparate()
|
||||||
|
if self.settings['saveBodyFile']:
|
||||||
|
self.saveBody()
|
||||||
|
self.log.info("L'elaborazione del file ha richiesto {:4.2f} sec".format(time.time()-self.beginTime))
|
||||||
|
|
||||||
|
except UnicodeDecodeError as ee:
|
||||||
|
self.log.critical("Il file [{}] contiene caratteri non compatibili con la codifica scelta! [{}]"
|
||||||
|
.format(self.fileParams['name'],ee))
|
||||||
|
except FileExistsError as fe:
|
||||||
|
self.log.critical(fe)
|
||||||
|
except BaseException as ee:
|
||||||
|
self.log.warning(ee)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def openFile(self):
|
||||||
|
try:
|
||||||
|
os.chdir(self.paths["INworkPath"])
|
||||||
|
self.log.info("Carico il contenuto..")
|
||||||
|
fp = open(self.fileParams['name'], mode='r', encoding=self.settings['encoding'])
|
||||||
|
self.rawFile = fp.readlines()
|
||||||
|
fp.close()
|
||||||
|
except IOError as e:
|
||||||
|
self.log.critical("Impossibile aprire il file: {}! [{}]".format(self.fileName,e))
|
||||||
|
raise BaseException("OpenFile")
|
||||||
|
os.rmdir(self.outPath)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def remEmptyLines(self):
|
||||||
|
self.log.info("Elimino righe vuote e caratteri inutili..")
|
||||||
|
tempContent = []
|
||||||
|
try:
|
||||||
|
for ll in self.rawFile:
|
||||||
|
for c in self.settings['delChars']:
|
||||||
|
ll = ll.replace(c,'')
|
||||||
|
if ll not in ['\n', '\r']:
|
||||||
|
tempContent.append(ll)
|
||||||
|
self.rawFile = copy.deepcopy(tempContent)
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
self.log.error("Errore inaspettato durante l'eliminazione delle righe vuote!")
|
||||||
|
raise BaseException("DelLines")
|
||||||
|
del tempContent
|
||||||
|
|
||||||
|
def splitFile(self): #porting del codice dal programma originale
|
||||||
|
self.log.info("Individuo il contenuto..")
|
||||||
|
self.bodyCounter=0
|
||||||
|
self.duplicateNumber=0
|
||||||
|
docNumber = 0
|
||||||
|
docSkipped = 0
|
||||||
|
docDate = {}
|
||||||
|
title = ''
|
||||||
|
prevLine = ''
|
||||||
|
newsPaperName = ''
|
||||||
|
titleBegin = False
|
||||||
|
tempBody = list()
|
||||||
|
docSep=re.compile(self.docStruct['docSep'])
|
||||||
|
|
||||||
|
for l in self.rawFile: #per ogni linea del file
|
||||||
|
lineWords = l.lstrip().split(' ') #dividi la riga in parole
|
||||||
|
if self.status == 'first':
|
||||||
|
#prendo il numero di documento per vedere se ci sono buchi
|
||||||
|
try:
|
||||||
|
try:
|
||||||
|
nn = parse.parse("{current:d} Of {total} Documents",l.strip().capitalize()).named
|
||||||
|
if nn["current"]-docNumber==1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if self.settings["showSkipped"]:
|
||||||
|
self.log.warn("Il conto dei documenti non torna! LexisNexis \
|
||||||
|
ne ha saltato qualcuno!\nPrecedente:{0}-Attuale:{1}".format(docNumber,nn["current"]))
|
||||||
|
docSkipped+=1
|
||||||
|
docNumber = nn["current"]
|
||||||
|
except:
|
||||||
|
pass #non segnalare eccezione se il parse fallisce
|
||||||
|
# ricerco la data
|
||||||
|
if (lineWords[self.settings['monthPosition']]).capitalize() in self.docStruct['dateWords']:
|
||||||
|
try:
|
||||||
|
docDate=parse.parse(self.docStruct['dateFormat'],l).named
|
||||||
|
docDate['month']=docDate['month'].lstrip().rstrip().capitalize()
|
||||||
|
docDate['month']=self.docStruct['dateWords'].index(docDate['month'])+1
|
||||||
|
title = ''
|
||||||
|
titleBegin=True
|
||||||
|
# dopo la data inizia il titolo, ma prima si cerca il nome del giornale
|
||||||
|
if self.settings['getNewsPaperName']:
|
||||||
|
try:
|
||||||
|
if prevLine.split(' ')[0].strip().isalpha():
|
||||||
|
newsPaperName = prevLine.strip()
|
||||||
|
else:
|
||||||
|
newsPaperName = self.settings['nameNotFoundStr']
|
||||||
|
except:
|
||||||
|
self.log.warn("E' successo qualcosa mentre stavo cercando il nome della pubblicazione,\
|
||||||
|
controlla i file di uscita! [{}]".format(prevLine.strip()))
|
||||||
|
else:
|
||||||
|
newsPaperName = self.settings['nameNotFoundStr']
|
||||||
|
except:
|
||||||
|
self.log.warn("Ho trovato una riga ambigua.. potrebbe essere una data ma non so: [{}]". format(l.strip('\r\n')))
|
||||||
|
pass
|
||||||
|
elif lineWords[0] in self.docStruct['headWords']:
|
||||||
|
#cambio stato e inizializzo un nuovo documento da riempire
|
||||||
|
self.status = 'head'
|
||||||
|
newDoc=dict()
|
||||||
|
newDoc['title']=title
|
||||||
|
newDoc['date']=docDate
|
||||||
|
newDoc['newsPaperName'] = newsPaperName
|
||||||
|
titleBegin=False
|
||||||
|
else:
|
||||||
|
if titleBegin:
|
||||||
|
title += l.strip().capitalize()
|
||||||
|
except IndexError:
|
||||||
|
self.log.error("Errore inaspettato, contatta il tuo sviluppatore di fiducia!")
|
||||||
|
pass
|
||||||
|
elif self.status == 'head':
|
||||||
|
tempContent = list()
|
||||||
|
if lineWords[0] not in self.docStruct['headWords']: #se la prima parola non e' tra quelle di inizio
|
||||||
|
tempBody.append(l) # vuol dire che ho trovato l'articolo e aggiungo la prima riga al contenuto del documento
|
||||||
|
self.status = 'body'
|
||||||
|
pass
|
||||||
|
elif self.status == 'body':
|
||||||
|
if not lineWords[0] in self.docStruct['tailWords']: #se la prima parola non e' tra quelle di fine
|
||||||
|
if self.settings['delLF']:
|
||||||
|
tempBody.append(l.strip('\n')) #allora sto leggendo l'articolo
|
||||||
|
else:
|
||||||
|
tempBody.append(l)
|
||||||
|
else:
|
||||||
|
self.status = 'tail'
|
||||||
|
anomaly = False
|
||||||
|
if docSep.match(l) is not None: #controlla se ci sono articoli che non hanno le parole chiave finali
|
||||||
|
self.log.warn("Ho individuato una separatore valido prima che si chiusesse l'articolo precedente, controlla i tuoi file in uscita!\n\
|
||||||
|
L'errore dovrebbe essere intorno all'articolo {} ma non sono sicuro! \n\t\t[{}]".format(docNumber, l.strip()))
|
||||||
|
self.status = 'tail'
|
||||||
|
anomaly = True
|
||||||
|
pass
|
||||||
|
elif self.status == 'tail':
|
||||||
|
if docSep.match(l) is not None or anomaly:
|
||||||
|
self.status = 'first'
|
||||||
|
anomaly = False
|
||||||
|
if self.settings['delWordBreak']:
|
||||||
|
tempContent=[ll.replace('-\n', '') for ll in tempContent]
|
||||||
|
newDoc['content']=copy.deepcopy(''.join(tempBody))
|
||||||
|
self.fileList.append(copy.deepcopy(newDoc))
|
||||||
|
tempBody=list()
|
||||||
|
self.bodyCounter +=1
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.log.critical("Stato Interno Sconosciuto")
|
||||||
|
prevLine=l #salva sempre e comunque il contenuto della linea precedente
|
||||||
|
pass
|
||||||
|
#ricerca terminata, espongo i risultati
|
||||||
|
self.log.info("Nel file ho trovato {0} articoli..".format(self.bodyCounter))
|
||||||
|
if docSkipped > 0:
|
||||||
|
self.log.warn("Attentione, LexisNexis ne ha saltati {} !!!".format(docSkipped))
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
|
||||||
|
def removeDuplicates(self):
|
||||||
|
titleList=[]
|
||||||
|
duplicateList=[]
|
||||||
|
for idx, ff in enumerate(self.fileList):
|
||||||
|
if ff['title'] not in titleList:
|
||||||
|
titleList.append(ff['title'])
|
||||||
|
ff['duplicate']=False
|
||||||
|
self.fileList[idx]=ff
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if ff['title'] not in duplicateList:
|
||||||
|
duplicateList.append(ff['title'])
|
||||||
|
if self.settings['showRemovedDuplicates']:
|
||||||
|
self.log.info("Duplicato: {}".format(ff['title'].strip()))
|
||||||
|
ff['duplicate'] = True
|
||||||
|
self.fileList[idx]=ff
|
||||||
|
self.duplicateNumber+=1
|
||||||
|
self.log.info("Ho rimosso {} duplicati di {} articoli..". format(self.duplicateNumber, len(duplicateList)))
|
||||||
|
pass
|
||||||
|
|
||||||
|
def saveSeparate(self):
|
||||||
|
outFileCounter = 0
|
||||||
|
self.paths['OUTworkPath']=self.paths['OUTworkPath']+slugify(self.fileName)
|
||||||
|
self.log.info("Salvo gli articoli in file separati...")
|
||||||
|
self.log.debug("Persorso: {0}".format(self.paths['OUTworkPath'].format('nomeFile')))
|
||||||
|
for ff in self.fileList:
|
||||||
|
try:
|
||||||
|
if ff['duplicate'] == False:
|
||||||
|
fName=self.paths['OUTnameFormat'].format(title=slugify(ff['title'][:self.settings['maxTitleLen']]),\
|
||||||
|
filename=slugify(self.fileName),\
|
||||||
|
docnum=outFileCounter,\
|
||||||
|
papername=ff['newsPaperName'].strip(),\
|
||||||
|
**ff['date'])
|
||||||
|
out=open('{0}'.format(fName),'wb')
|
||||||
|
if self.settings['includeTitle']:
|
||||||
|
ff['content'] = ff['title']+os.linesep+ff['content']
|
||||||
|
out.write(ff['content'].encode(self.settings['encoding']))
|
||||||
|
out.close()
|
||||||
|
outFileCounter+=1
|
||||||
|
except IOError as e:
|
||||||
|
self.log.error("Qualcosa e\' andato storto, non riesco a scrivere il file: {}".format(e))
|
||||||
|
continue
|
||||||
|
if outFileCounter < self.bodyCounter:
|
||||||
|
raise BaseException("Ho salvato meno file rispetto a quelli trovati!")
|
||||||
|
pass
|
||||||
|
|
||||||
|
def saveBody(self):
|
||||||
|
self.log.info('Salvo gli articoli in un singolo file vicino agli originali...')
|
||||||
|
self.log.debug('Persorso: {0}'.format(self.outPath))
|
||||||
|
os.chdir(self.outPath)
|
||||||
|
try:
|
||||||
|
fName=slugify(self.fileName)
|
||||||
|
fName='BODYFILE_{0}.txt'.format(fName[:self.settings['maxTitleLen']])
|
||||||
|
fileContent = os.linesep.join([cc['content'] for cc in self.fileList])
|
||||||
|
out=open('{0}'.format(fName),'wb')
|
||||||
|
out.write(fileContent.encode(self.settings['encoding']))
|
||||||
|
out.close()
|
||||||
|
except IOError as e:
|
||||||
|
self.log.error("Qualcosa e\' andato storto, non riesco a scrivere il file: {}".format(e))
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
83
bananaSPLIT/libbananasplit/testEN.json
Normal file
83
bananaSPLIT/libbananasplit/testEN.json
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
{
|
||||||
|
"version": "v1.1a",
|
||||||
|
"logger": {
|
||||||
|
"logFile": "D:\\Test\\bananaSPLIT.log",
|
||||||
|
"logFormat": "%(asctime)s|%(levelname)-8s| %(message)-50s",
|
||||||
|
"logTimeFormat": "%m-%d %H:%M:%S"
|
||||||
|
},
|
||||||
|
"splitter": {
|
||||||
|
"name": "",
|
||||||
|
"paths": {
|
||||||
|
"INworkPath": "D:\\Emanuele\\Documenti\\workspace\\bananaSPLIT\\TestFiles\\",
|
||||||
|
"OUTworkPath": "H:\\",
|
||||||
|
"OUTnameFormat": "TEST_{docnum}_{year:04d}{month:02d}{day:02d}_{title}.txt"
|
||||||
|
},
|
||||||
|
"docStruct": {
|
||||||
|
"docSep": "\\s*Copyright [(0-9)]+",
|
||||||
|
"dateFormat": "{month} {day:d}, {year:d}{}",
|
||||||
|
"dateWords": [
|
||||||
|
"January",
|
||||||
|
"February",
|
||||||
|
"March",
|
||||||
|
"April",
|
||||||
|
"May",
|
||||||
|
"June",
|
||||||
|
"July",
|
||||||
|
"August",
|
||||||
|
"September",
|
||||||
|
"October",
|
||||||
|
"November",
|
||||||
|
"December"
|
||||||
|
],
|
||||||
|
"headWords": [
|
||||||
|
"BYLINE:",
|
||||||
|
"SECTION:",
|
||||||
|
"LENGTH:",
|
||||||
|
"DATELINE:",
|
||||||
|
"HIGHLIGHT:",
|
||||||
|
"Email:"
|
||||||
|
],
|
||||||
|
"tailWords": [
|
||||||
|
"Newstex ID:",
|
||||||
|
"NOTES:",
|
||||||
|
"LANGUAGE:",
|
||||||
|
"GRAPHIC:",
|
||||||
|
"TYPE:",
|
||||||
|
"URL:",
|
||||||
|
"LOAD-DATE:",
|
||||||
|
"PUBLICATION-TYPE:",
|
||||||
|
"DOCUMENT-TYPE:",
|
||||||
|
"CHARTS:",
|
||||||
|
"JOURNAL-CODE:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"encoding": "utf-8",
|
||||||
|
"monthPosition": 0,
|
||||||
|
"getNewsPaperName": true,
|
||||||
|
"nameNotFoundStr": "ND",
|
||||||
|
"includeTitle": true,
|
||||||
|
"removeDuplicates": true,
|
||||||
|
"showSkipped": true,
|
||||||
|
"showRemovedDuplicates": false,
|
||||||
|
"maxTitleLen": 32,
|
||||||
|
"loadTXT": true,
|
||||||
|
"loadDOCX": false,
|
||||||
|
"removeOldFiles": true,
|
||||||
|
"saveSeparateFiles": true,
|
||||||
|
"saveBodyFile": true,
|
||||||
|
"saveBodyNumber": true,
|
||||||
|
"delLF": false,
|
||||||
|
"delWordBreak": true,
|
||||||
|
"delChars": [
|
||||||
|
"'",
|
||||||
|
"@",
|
||||||
|
"#",
|
||||||
|
"$",
|
||||||
|
"%",
|
||||||
|
"^",
|
||||||
|
"&"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
80
bananaSPLIT/libbananasplit/testITA.json
Normal file
80
bananaSPLIT/libbananasplit/testITA.json
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"version": "v1.1a",
|
||||||
|
"logger": {
|
||||||
|
"logFile": "D:\\Test\\bananaSPLIT.log",
|
||||||
|
"logFormat": "%(asctime)s|%(levelname)-8s| %(message)-50s",
|
||||||
|
"logTimeFormat": "%m-%d %H:%M:%S"
|
||||||
|
},
|
||||||
|
"splitter": {
|
||||||
|
"name": "",
|
||||||
|
"paths": {
|
||||||
|
"INworkPath": "D:\\Emanuele\\Documenti\\workspace\\bananaSPLIT\\TestFiles\\",
|
||||||
|
"OUTworkPath": "H:\\",
|
||||||
|
"OUTnameFormat": "TEST_{docnum}_{year:04d}{month:02d}{day:02d}_{title}.txt"
|
||||||
|
},
|
||||||
|
"docStruct": {
|
||||||
|
"docSep": "Copyright [(0-9)]+",
|
||||||
|
"dateFormat": "{day:d} {month} {year:d} {}",
|
||||||
|
"dateWords": [
|
||||||
|
"Gennaio",
|
||||||
|
"Febbraio",
|
||||||
|
"Marzo",
|
||||||
|
"Aprile",
|
||||||
|
"Maggio",
|
||||||
|
"Giugno",
|
||||||
|
"Luglio",
|
||||||
|
"Agosto",
|
||||||
|
"Settembre",
|
||||||
|
"Ottobre",
|
||||||
|
"Novembre",
|
||||||
|
"Dicembre"
|
||||||
|
],
|
||||||
|
"headWords": [
|
||||||
|
"BYLINE:",
|
||||||
|
"SECTION:",
|
||||||
|
"LENGTH:",
|
||||||
|
"DATELINE:",
|
||||||
|
"HIGHLIGHT:",
|
||||||
|
"Email:"
|
||||||
|
],
|
||||||
|
"tailWords": [
|
||||||
|
"LANGUAGE:",
|
||||||
|
"GRAPHIC:",
|
||||||
|
"TYPE:",
|
||||||
|
"URL:",
|
||||||
|
"LOAD-DATE:",
|
||||||
|
"PUBLICATION-TYPE:",
|
||||||
|
"DOCUMENT-TYPE:",
|
||||||
|
"CHARTS:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"encoding": "utf-8",
|
||||||
|
"monthPosition": 0,
|
||||||
|
"getNewsPaperName": true,
|
||||||
|
"nameNotFoundStr": "ND",
|
||||||
|
"includeTitle": true,
|
||||||
|
"removeDuplicates": true,
|
||||||
|
"showSkipped": false,
|
||||||
|
"showRemovedDuplicates": true,
|
||||||
|
"maxTitleLen": 32,
|
||||||
|
"loadTXT": true,
|
||||||
|
"loadDOCX": false,
|
||||||
|
"removeOldFiles": true,
|
||||||
|
"saveSeparateFiles": true,
|
||||||
|
"saveBodyFile": true,
|
||||||
|
"saveBodyNumber": true,
|
||||||
|
"delLF": false,
|
||||||
|
"delWordBreak": true,
|
||||||
|
"delChars": [
|
||||||
|
"'",
|
||||||
|
"@",
|
||||||
|
"#",
|
||||||
|
"$",
|
||||||
|
"%",
|
||||||
|
"^",
|
||||||
|
"&"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
35
bananaSPLIT/libtestmain.py
Normal file
35
bananaSPLIT/libtestmain.py
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
'''
|
||||||
|
Created on 1 dic 2019
|
||||||
|
|
||||||
|
@author: Emanuele Trabattoni
|
||||||
|
'''
|
||||||
|
import os
|
||||||
|
from glob import glob
|
||||||
|
from copy import deepcopy
|
||||||
|
from libsplit import bananaSPLITTER
|
||||||
|
from libconfload import bananaCONF
|
||||||
|
from libfancylogger import fancyLogger
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("CWD-> "+os.getcwd())
|
||||||
|
logger = fancyLogger(fileLog = False)
|
||||||
|
confl = bananaCONF(workdir=r"./libbananasplit", logger=logger)
|
||||||
|
confl.open()
|
||||||
|
|
||||||
|
confl.use("testEN.json")
|
||||||
|
splconf = confl.getParams("splitter")
|
||||||
|
splist = []
|
||||||
|
os.chdir(splconf["paths"]["INworkPath"])
|
||||||
|
for f in glob("*.txt"):
|
||||||
|
splconf["name"] = f
|
||||||
|
logger.info("-"*80)
|
||||||
|
splitter = bananaSPLITTER(fileParams=deepcopy(splconf), logger=logger)
|
||||||
|
splist.append(splitter)
|
||||||
|
splitter.start()
|
||||||
|
splitter.join()
|
||||||
|
|
||||||
|
logger.info("\n"+"="*50+"\n\tFINITO!!!\n"+"="*50)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user