Exemple #1
0
    if uid == 0:
        print('Do not run persepolis as root.')
        sys.exit(1)

from persepolis.scripts import osCommands
import argparse
import struct
import json

# initialization

# find home address
home_address = os.path.expanduser("~")

# persepolis config_folder
config_folder = determineConfigFolder(os_type, home_address)

# persepolis tmp folder path
persepolis_tmp = os.path.join(config_folder, 'persepolis_tmp')

# if lock_file_validation == True >> not another instanse running,
# else >> another instanse of persepolis is running now.
global lock_file_validation

if os_type != 'Windows':
    import fcntl
    user_name_split = home_address.split('/')
    user_name = user_name_split[2]
    # persepolis lock file
    lock_file = '/tmp/persepolis_exec_' + user_name + '.lock'
Exemple #2
0
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

from persepolis.scripts.useful_tools import determineConfigFolder
from persepolis.gui.log_window_ui import LogWindow_Ui
from persepolis.scripts import osCommands
from PyQt5.QtCore import QPoint, QSize
from PyQt5.QtGui import QIcon
from PyQt5 import QtWidgets
import os

# config_folder
config_folder = determineConfigFolder()

class LogWindow(LogWindow_Ui):
    def __init__(self, persepolis_setting):
        super().__init__(persepolis_setting)

        self.persepolis_setting = persepolis_setting

        self.copy_log_pushButton.setEnabled(False)

# log file address
        self.log_file = os.path.join(str(config_folder), 'persepolisdm.log')

        f = open(self.log_file, 'r')
        f_lines = f.readlines()
        f.close()
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

from persepolis.scripts.useful_tools import determineConfigFolder
from persepolis.scripts.osCommands import remove, removeDir
from persepolis.scripts.data_base import PersepolisDB 
from persepolis.scripts.newopen import readList
import time
import ast
import os

# config_folder
config_folder = determineConfigFolder()

download_info_folder = os.path.join(config_folder, "download_info")


# download_list_file contains GID of all downloads
download_list_file = os.path.join(config_folder, "download_list_file")

# download_list_file_active for active downloads
download_list_file_active = os.path.join(
    config_folder, "download_list_file_active")

# queues_list contains queues name
queues_list_file = os.path.join(config_folder, 'queues_list')

# category_folder contains some file , and every files named with queues .