"Fossies" - the Fresh Open Source Software Archive

Member "namefix.pl/libs/global_variables.pm" (30 Jan 2010, 10373 Bytes) of package /linux/privat/old/namefix.pl_4.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "global_variables.pm" see the Fossies "Dox" file reference documentation.

    1 # global variables
    2 
    3 # variables that need to be declacred 1st
    4 # for use with home directory and os dependant variables
    5 
    6 our $version        = "4.0.2";
    7 our $author         = "Jacob Jarick";
    8 our $debug      = "0";
    9 
   10 # DEBUG LEVELS - WIP
   11 # 0 = log always - important errors etc
   12 # 1
   13 # 2
   14 # 3 = print subnames etc
   15 # 4 = print details of sub
   16 
   17 our $load_defaults  = 0;
   18 our $config_version     = "";
   19 
   20 our $dir = $ARGV[0];
   21 our $home = "";
   22 our $fs_fix_default = 0;
   23 
   24 our $overwrite  = 0;
   25 
   26 # Detect enviroment and setup namefix directories
   27 
   28 our $nf_dir = $main::prog_dir."/";
   29 
   30 if(!$dir) 
   31 {
   32         $dir = cwd;
   33 }
   34 
   35 if($^O eq "MSWin32") 
   36 {
   37         $home = $ENV{"USERPROFILE"};
   38         $fs_fix_default = 1;
   39         our $dialog_font    = "ansi 8 bold";
   40         our $dialog_title_font  = "ansi 12 bold";
   41         our $edit_pat_font  = "ansi 16 bold";
   42         our $dir_slash      = "\\";
   43 }
   44 else 
   45 {
   46         $fs_fix_default = 0;
   47         $home = $ENV{"HOME"},
   48         our $dialog_font    = "ansi 10";
   49         our $dialog_title_font  = "ansi 16 bold";
   50         our $edit_pat_font  = "ansi 18 bold";
   51         our $dir_slash      = "\/";
   52 }
   53 
   54 if(!$home) 
   55 {
   56         $home = $ENV{"TMP"};    # surely the os has a tmp if nothing else
   57 }
   58 
   59 if(!-d "$home/.namefix.pl") 
   60 {
   61         mkdir("$home/.namefix.pl", 0755) || die "Cannot mkdir :$home/.namefix.pl $!\n";
   62 }
   63 
   64 # File locations
   65 
   66 our $config_file    = "$home/.namefix.pl/config.ini";
   67 our $fonts_file     = "$home/.namefix.pl/fonts.ini";
   68 our $bm_pl      = "$home/.namefix.pl/bm.ini";
   69 our $log_file       = "$home/.namefix.pl/logfile.txt";
   70 our $casing_file        = "$home/.namefix.pl/list_special_word_casing.txt";
   71 our $killwords_file     = "$home/.namefix.pl/list_rm_words.txt";
   72 our $killpat_file       = "$home/.namefix.pl/list_rm_patterns.txt";
   73 our $bookmark_file  = "$home/.namefix.pl/list_bookmarks.txt";
   74 our $changelog      = "$prog_dir/txt/changelog.txt";
   75 our $about      = "$prog_dir/txt/about.txt";
   76 our $todo       = "$prog_dir/txt/todo.txt";
   77 our $thanks     = "$prog_dir/txt/thanks.txt";
   78 our $links      = "$prog_dir/txt/links.txt";
   79 
   80 our $namefix_log_file   = "$home/.namefix.pl/namefix.pl"."$version"."log";
   81 our $namefix_error_file = "$home/.namefix.pl/namefix.pl"."$version"."error.log";
   82 
   83 our $mempic         = $nf_dir."mem.jpg";
   84 
   85 our $html_file      = "$home/.namefix.pl/namefix_html_output_hack.html";
   86 
   87 our $undo_cur_file  = "$home/.namefix.pl/undo.current.filenames.txt";
   88 our $undo_pre_file  = "$home/.namefix.pl/undo.previous.filenames.txt";
   89 our $undo_dir_file  = "$home/.namefix.pl/undo.dir.txt";
   90 
   91 our $browser        = "elinks";
   92 our $editor     = "vim";
   93 
   94 # system internal vars
   95 
   96 our $cwd        = $dir;
   97 our $hlist_cwd      = $cwd;
   98 our $hlist_file     = "";
   99 our $testmode       = 1;
  100 our $change         = 0;
  101 our $id3_change     = 0;    # counter for changes made 2 id3 tags
  102 our $tags_rm        = 0;    # counter for number of tags removed
  103 our $id3_writeme    = 0;    # used for missing id3v1/id3v2 that can be filled in from each other
  104 our $suggestF       = 0;    # suggest using fsfix var
  105 our $tmpfilefound   = 0;
  106 our $tmpfilelist    = "";
  107 our $enum_count     = 0;
  108 our $rpwold_escaped = "";
  109 our $last_recr_dir  = "";
  110 our $hl_counter     = 0;
  111 our @bm_arr         = "";   # bookmark array
  112 our $bm_menu_hash   = "";
  113 our $bm_count       = 0;
  114 our $hlist_selection    = 0;    # current line selected
  115 
  116 our $delay      = 3;        # delay
  117 our $update_delay   = $main::delay; # initial value
  118 
  119 # internal flags
  120 # note: its been my decision that all internal flags will be in UC
  121 # should make the app more c like (I hope), and if not its still tidier.
  122 
  123 our $RUN        = 0;
  124 our $STOP       = 0;
  125 our $LISTING        = 0;
  126 our $FIRST_DIR_LISTED   = 0;
  127 our $BR_DONE        = 0;    # a block rename has occured
  128 our $MR_DONE        = 0;    # a manual rename has occured
  129 our $FILTER     = 0;    # filter flag, to be used for main gui in future - atm just used in block renaming
  130 our $ERROR_NOTIFY   = 0;
  131 our $ERROR_STDOUT   = 1;
  132 our $LOG_STDOUT     = 0;
  133 our $ZERO_LOG       = 1;
  134 our $HTML_HACK      = 0;
  135 our $UNDO       = 0;
  136 
  137 our $SAVE_WINDOW_SIZE   = 0;
  138 
  139 our $CLI        = 0;
  140 
  141 # filter options
  142 
  143 our $filter_string = "";
  144 our $filter_use_re = 0;
  145 our $filter_string_escaped = "";
  146 our $filter_cs = 0;
  147 
  148 # preference options - save enabled
  149 
  150 our $cleanup        = 1;
  151 our $case       = 1;
  152 our $advance        = 0;
  153 our $space_character    = " ";
  154 our $max_fn_length  = 256;
  155 our $truncate_to        = $max_fn_length;
  156 
  157 our $id3_guess_tag  = 0;
  158 our $id3_force_guess_tag    = 0;
  159 our $id3_mode       = 0;
  160 
  161 our $window_g       = "";
  162 
  163 our $fat32fix       = $fs_fix_default;
  164 our $disable_regexp     = 1;
  165 our $file_ext_2_proc    = "jpeg|jpg|mp3|mpc|mpg|mpeg|avi|asf|wmf|wmv|ogg|ogm|rm|rmvb|mkv";
  166 
  167 our $enum_opt       = 1;
  168 our $enum_pad       = 1;
  169 our $enum_pad_zeros     = "4";
  170 $enum_pad_zeros     = 4;
  171 
  172 our $truncate_style     = 0;
  173 our $trunc_char     = "";
  174 
  175 
  176 # main window options - save enabled
  177 
  178 our $sp_word        = 0;
  179 our $spaces     = 1;
  180 our $dot2space      = 0;
  181 our $intr_char      = 0;
  182 our $kill_cwords    = 0;
  183 our $kill_sp_patterns   = 0;
  184 our $sp_char        = 0;
  185 
  186 # main window, misc options - no save allowed
  187 
  188 our $scene      = 0;
  189 our $unscene        = 0;
  190 
  191 our $rm_digits      = 0;
  192 our $digits         = 0;
  193 
  194 our $pad_dash       = 0;
  195 our $pad_digits     = 0;
  196 our $pad_digits_w_zero  = 0;
  197 
  198 # main window options - no save allowed
  199 
  200 our $enum       = 0;    # enumerate mode
  201 our $truncate       = 0;
  202 our $uc_all     = 0;
  203 our $lc_all     = 0;
  204 
  205 our $replace        = 0;
  206 our $rpwold     = "";
  207 our $rpwnew     = "";
  208 
  209 our $front_a        = 0;
  210 our $faw        = "";
  211 our $end_a      = 0;
  212 our $eaw        = "";
  213 
  214 our $recr       = 0;
  215 our $proc_dirs      = 0;
  216 our $ig_type        = 0;
  217 
  218 # main window, id3 tag vars
  219 
  220 our $id3_art_set    = 0;
  221 our $id3_art_str    = "";
  222 
  223 our $id3_alb_set    = 0;
  224 our $id3_alb_str    = "";
  225 
  226 our $id3_com_set    = 0;
  227 our $id3_com_str    = "";
  228 
  229 our $id3v1_rm       = 0;
  230 our $id3v2_rm       = 0;
  231 
  232 $main::id3_gen_set  = 0;
  233 $main::id3_gen_str  = "Metal";
  234 
  235 $main::id3_year_set     = 0;
  236 $main::id3_year_str     = "";
  237 
  238 $main::split_dddd   = 0;
  239 
  240 our @undo_cur   = ();   # undo array - current filenames
  241 our @undo_pre   = ();   # undo array - previous filenames
  242 
  243 our @find_arr   = ();
  244 
  245 our $undo_dir   = "";   # directory to preform undo in
  246 
  247 # all prefined arrays.
  248 
  249 # Kill Common Words array, for safety reasons all are case specific.
  250 @main::kill_words_arr = 
  251 (
  252         # net sites
  253         'ShareReactor',
  254         'ShareConnector',
  255         'Sharevirus',
  256         'English.[www.tvu.org.ru]',
  257     '[www.tvu.org.ru]',
  258     '[tvu.org.ru]',
  259 
  260         # misc
  261     '2HD',
  262         'ac3',
  263         'divx',
  264         'dsrip',
  265         'DVDrip',
  266         'DVDscr',
  267     'DVD',
  268         'hdtv',
  269         'HDRip',
  270     'preair',
  271     'SATRip',
  272         'tv',
  273         'WS',       # wide screen
  274         'xvid',
  275 
  276         # mp3/divx/xvid Ripper tags
  277     '0TV',
  278     'aaf',
  279     'aXXo',     # love your rips man
  280     'BayHarborButcher',
  281     'Bia',
  282     'bsgtv',
  283     'Caph',
  284         'Crimson',
  285         'DMT',
  286         'DiAMOND',
  287     'Dvsky',
  288         'Saphire',
  289         'FoV',
  290     'FQM',
  291     'Gnarly',
  292     'klaxxon',
  293         'LoL',
  294         'LoKi',
  295         'l0ki',
  296     '[Moonsong]',
  297         'pdtv',
  298         'rns',
  299         'VFUA',
  300         'VTV',
  301         'dsr',
  302         'tcm',
  303         'fqm',
  304         'notv',
  305         'kyr',
  306         'aaf',
  307         'xor',
  308         'ctu',
  309         'repack',
  310     'OMiCRON',
  311         'orenji',
  312         'sdtv',
  313     'STFU',
  314     'sys',
  315         'tvd',
  316         '2sd'
  317 );
  318 @main::kill_words_arr_escaped = ();
  319 
  320 # Big Word Casing List
  321 
  322 # Douglas: Thanks to the great folk at karanet for the help with the following list!
  323 # ( ssh bbs@karanet.uni-klu.ac.at )
  324 
  325 @main::word_casing_arr = 
  326 (
  327         'ABBA', 'ABC', 'AC', 'ACDC', 'ATC',
  328         'BSB',
  329         'CIA', 'CNN',
  330         'CD', 'CD1', 'CD2', 'CD3', 'CD4',
  331         'DNA', 'DC', 'DJ', 'DVD', 'DVDRip', 'DivX', 'DVDA',
  332         'FBI', 'FM',
  333         'II', 'III', 'IV',
  334         'KGB',
  335         'LSD',
  336         'MadTV', 'MASH', 'MTV', 'MIB',
  337         'NIN',
  338         'OK', 'OST', 'OVA',
  339         'USSR', 'USA',
  340         'REM',
  341         'STS', 'SNK', 'SG-1',
  342         'TV', 'THC', 'TimTim', 'TNT',
  343         'UK',
  344         'vs', 'VI', 'VII', 'VII',
  345         'YMCA',
  346         'XXX', 'Xvid', 'IX', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII',
  347         'a', 'an', 'at', 'and', 'are', 'for', 'in', 'is', 'it', 'of', 'on', 'the', 'to',
  348         '- A', '- At', '- An', '- And', 'Are', '- For', '- In', '- Is', '- It', '- Of', '- On', '- The', '- To'
  349 );
  350 
  351 @main::word_casing_arr_escaped = @main::word_casing_arr; # default list does not need escaping
  352 
  353 @main::kill_patterns_arr = 
  354 (
  355         '(\(|\[)(divx|dvdrip|dvd|tv|xvid)(\]|\))',
  356     '(\(|\[)(www\..*?|)\.(com|net|de|tk|ru|nl)(\]|\))',
  357     '(\[|\()(\]|\))',
  358     '(\[[a-f0-9]*\])'
  359 );
  360 
  361 @main::genres = 
  362 (
  363     "A Capella", "Acid", "Acid Jazz", "Acid Punk", "Acoustic", "Alt. Rock", "Alternative", "Ambient", "Anime", "Avantgarde", 
  364     "Ballad", "Bass", "Beat", "Bebob", "Big Band", "Black Metal", "Bluegrass", "Blues", "Booty Bass", "BritPop", 
  365     "Cabaret", "Celtic", "Chamber Music", "Chanson", "Chorus", "Christian Gangsta Rap", "Christian Rap", "Christian Rock", "Classic Rock", "Classical", "Club", "Club-House", "Comedy", "Contemporary Christian", "Country", "Crossover", "Cult", 
  366     "Dance", "Dance Hall", "Darkwave", "Death Metal", "Disco", "Dream", "Drum & Bass", "Drum Solo", "Duet", 
  367     "Easy Listening", "Electronic", "Ethnic", "Euro-House", "Euro-Techno", "Eurodance", 
  368     "Folk", "Folk/Rock", "Folklore", "Freestyle", "Funk", "Fusion", "Fusion", 
  369     "Game", "Gangsta", "Goa", "Gospel", "Gothic", "Gothic Rock", "Grunge", 
  370     "Hard Rock", "Hardcore", "Heavy Metal", "Hip-Hop", "House", "Humour", 
  371     "Indie", "Industrial", "Instrum. Pop", "Instrum. Rock", "Instrumental", 
  372     "Jazz", "Jazz+Funk", "Jpop", "Jungle", 
  373     "Latin", "Lo-Fi", 
  374     "Meditative", "Merengue", "Metal", "Musical", 
  375     "National Folk", "Native American", "Negerpunk", "New Age", "New Wave", "Noise", 
  376     "Oldies", "Opera", "Other", "Polka", "Polsk Punk", "Pop", "Pop-Folk", "Pop/Funk", "Porn Groove", "Power Ballad", "Pranks", "Primus", "Progress. Rock", "Psychadel. Rock", "Psychadelic", "Punk", "Punk Rock", 
  377     "R&B", "Rap", "Rave", "Reggae", "Retro", "Revival", "Rhythmic Soul", "Rock", "Rock & Roll", 
  378     "Salsa", "Samba", "Satire", "Showtunes", "Ska", "Slow Jam", "Slow Rock", "Sonata", "Soul", "Sound Clip", "Soundtrack", "Southern Rock", "Space", "Speech", "Swing", "Symphonic Rock", "Symphony", "Synthpop", 
  379     "Tango", "Techno", "Techno-Indust.", "Terror", "Thrash Metal", "Top 40", "Trailer", "Trance", "Tribal", "Trip-Hop", 
  380     "Vocal"
  381 );
  382 
  383 
  384 1;